Skip to content

pod_phase tag on kubernetes.pods.running is misleading #11466

Open
@aquiladayc

Description

Observation

In my env, there's two failing pods.

NAMESPACE NAME                      READY   STATUS                     
default   postgres-A 0/1     Pending                 
test      postgres-B 1/2     ImagePullBackOff 
default   postgres-C 1/1     Running                 

kubernetes.pods.running returns 2.

This is because kubernetes.pods.running counts pods which has at least 1 container running inside.
Code link: https://github.com/DataDog/integrations-core/blob/master/kubelet/datadog_checks/kubelet/kubelet.py#L461

What is the problem?

pod_phase tag is quite confusing and non-sense for kubernetes.pods.running with 2 reasons.

Firstly, this metrics is counting Running pods. So metrics value is correct. However, as it only counts Running pod, it doesn't care about pod phase.
Secondly, pod_phase: pending for this metrics is not actually "Pending" as shown above.

This confusion becomes an issue when a user wants to count pending pods.

Suggestion for fix

Remove pod_phase tag from kubernetes.pods.running
Add something like fully_running and value can be yes or no (true or false)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions