prometheus: not getting all containers when using kube pod container resource requests cpu cores

9/3/2021

I am using prometheus to get the container resource request cpu cores. I am using the follwing code:

kube_pod_container_resource_requests_cpu_cores 

I am getting all the containers except one.

I used docker ps and i am seeing the container is started.

any idea why I am not getting the container in prometheus result ?

-- karlos
kubernetes
prometheus

1 Answer

9/4/2021

Does your container/pod request a CPU? As I've noticed this metric shouldn't return a value when the container/pod doesn't have the following: spec.containers[].resources.requests.cpu in its deployment or other kinds of objects where the container is defined.

-- Hayk Davtyan
Source: StackOverflow