-
Notifications
You must be signed in to change notification settings - Fork 1
Description
| CPU_METRIC = 'kube_pod_resource_request{unit="cores"}' |
This metric will gather cpu request by all pods regardless of if they are running or not.
So, if you had a pod that could not be scheduled we will still end up counting it's CPU requests.
I discovered this when I was trying to gather GPU usage data for the NERC openshift cluster, there was a pod that requested a GPU but it was never scheduled as the cluster does not have an active GPU.
One possible solution is to get an intersection like this:
https://github.com/naved001/xdmod-openshift-scripts/blob/d75e06698961a5b9f4db0ac4e86f4e11b30a41a8/openshift_metrics/openshift_prometheus_metrics.py#L26
it worked when I queried GPU metrics, but when I applied this intersection for CPU and Memory I got a 422 error code from prometheus and thanos. :/