Bug 1946865 - no "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namespace:kube_pod_container_resource_requests_memory_bytes:sum" metrics
Summary: no "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namesp...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.8.0
Assignee: Jan Fajerski
QA Contact: hongyan li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-07 04:33 UTC by Junqi Zhao
Modified: 2021-07-27 22:58 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-27 22:57:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
no "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namespace:kube_pod_container_resource_requests_memory_bytes:sum" metrics (152.98 KB, image/png)
2021-04-07 04:33 UTC, Junqi Zhao
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-monitoring-operator pull 1127 0 None open Bug 1946865: Update kube prometheus and related assets 2021-04-20 15:42:07 UTC
Github prometheus-operator kube-prometheus pull 1078 0 None closed Update kubernetes mixins 2021-04-20 07:37:46 UTC
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 22:58:17 UTC

Description Junqi Zhao 2021-04-07 04:33:46 UTC
Created attachment 1769750 [details]
no "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namespace:kube_pod_container_resource_requests_memory_bytes:sum" metrics

Created attachment 1769750 [details]
no "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namespace:kube_pod_container_resource_requests_memory_bytes:sum" metrics

Description of problem:
"Kubernetes / Compute Resources / Cluster" dashboard, no result for "CPU Requests Commitment" and "Memory Requests Commitment", on UI, the result shows "-"
click inspect to check
"CPU Requests Commitment" expression is
sum(namespace:kube_pod_container_resource_requests_cpu_cores:sum{cluster=""}) / sum(kube_node_status_allocatable{resource="cpu",cluster=""})

"Memory Requests Commitment" expression is
sum(namespace:kube_pod_container_resource_requests_memory_bytes:sum{cluster=""}) / sum(kube_node_status_allocatable{resource="memory",cluster=""})

checked, there is not "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namespace:kube_pod_container_resource_requests_memory_bytes:sum" metrics in cluster
only "kube_pod_container_resource_requests_cpu_cores" and "kube_pod_container_resource_requests_memory_bytes" exist
# token=`oc sa get-token prometheus-k8s -n openshift-monitoring`

# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- curl -k -H "Authorization: Bearer $token" 'https://prometheus-k8s.openshift-monitoring.svc:9091/api/v1/label/__name__/values' | jq | grep kube_pod_container_resource_requests_cpu_cores
    "kube_pod_container_resource_requests_cpu_cores",

# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- curl -k -H "Authorization: Bearer $token" 'https://prometheus-k8s.openshift-monitoring.svc:9091/api/v1/label/__name__/values' | jq | grep kube_pod_container_resource_requests_memory_bytes
    "kube_pod_container_resource_requests_memory_bytes",



Version-Release number of selected component (if applicable):
4.8.0-0.nightly-2021-04-06-162113

How reproducible:
always

Steps to Reproduce:
1. Go to admin console, "Monitoring - > Dashboard", choose "Kubernetes / Compute Resources / Cluster" dashboard
2.
3.

Actual results:
there is not "namespace:kube_pod_container_resource_requests_cpu_cores:sum" and "namespace:kube_pod_container_resource_requests_memory_bytes:sum" metrics in cluster

Expected results:


Additional info:

Comment 1 Junqi Zhao 2021-04-07 04:42:14 UTC
there are cpu/memory request for containers, example
# for i in $(kubectl -n openshift-monitoring get po --no-headers | awk '{print $1}'); do echo $i; kubectl -n openshift-monitoring get pod $i -o go-template='{{range.spec.containers}}{{"Container Name: "}}{{.name}}{{"\r\nresources: "}}{{.resources}}{{"\n"}}{{end}}'; echo -e "\n"; done
alertmanager-main-0
Container Name: alertmanager
resources: map[requests:map[cpu:4m memory:200Mi]]
Container Name: config-reloader
resources: map[requests:map[cpu:1m memory:10Mi]]
Container Name: alertmanager-proxy
resources: map[requests:map[cpu:1m memory:20Mi]]
Container Name: kube-rbac-proxy
resources: map[requests:map[cpu:1m memory:20Mi]]
Container Name: prom-label-proxy
resources: map[requests:map[cpu:1m memory:20Mi]]

Comment 7 hongyan li 2021-05-06 07:07:16 UTC
Test with payload 4.8.0-0.nightly-2021-05-06-003426

"Kubernetes / Compute Resources / Cluster" dashboard, results are correct for "CPU Requests Commitment" and "Memory Requests Commitment"
click inspect to check
"CPU Requests Commitment" expression is
sum(namespace_cpu:kube_pod_container_resource_requests:sum{cluster=""}) / sum(kube_node_status_allocatable{resource="cpu",cluster=""})

"Memory Requests Commitment" expression is
sum(namespace_memory:kube_pod_container_resource_requests:sum{cluster=""}) / sum(kube_node_status_allocatable{resource="memory",cluster=""})

Comment 10 errata-xmlrpc 2021-07-27 22:57:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438


Note You need to log in before you can comment on or make changes to this bug.