Skip to content

[CONTINT-5389] Collect kubelet_containers_per_pod_count in the kubelet check#24600

Open
sehgal23 wants to merge 1 commit into
masterfrom
arnav.sehgal/contint-5389/new-metric-metadata.csv
Open

[CONTINT-5389] Collect kubelet_containers_per_pod_count in the kubelet check#24600
sehgal23 wants to merge 1 commit into
masterfrom
arnav.sehgal/contint-5389/new-metric-metadata.csv

Conversation

@sehgal23

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Documents the kubernetes.kubelet.containers_per_pod.count and .sum metrics in kubelet/metadata.csv, corresponding to the kubelet's kubelet_containers_per_pod_count histogram now collected by the Agent.

Motivation

https://datadoghq.atlassian.net/browse/CONTINT-5389

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jul 17, 2026

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 91.09% (+2.77%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1687a9b | Docs | Datadog PR Page | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1687a9bc9c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread kubelet/metadata.csv
kubernetes.kubelet.pleg.relist_interval.count,gauge,,second,,The count of relisting pods in PLEG,0,kubernetes,k8s.pleg.relist_interv,
kubernetes.kubelet.pleg.relist_interval.sum,gauge,,,,The sum of interval in seconds between relisting in PLEG,0,kubernetes,k8s.pleg.relist_interv,
kubernetes.kubelet.containers_per_pod.count,gauge,,,,The number of pods observed when building the containers-per-pod distribution,0,kubernetes,k8s.containers_per_pod,
kubernetes.kubelet.containers_per_pod.sum,gauge,,,,The total number of containers across all pods on the node,0,kubernetes,k8s.containers_per_pod,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe the cumulative histogram sum accurately

When the kubelet has observed pods over time, this Prometheus histogram's _sum is the cumulative sum of all container-count observations since the kubelet process started; it does not decrease when pods leave. Describing it as the total across all pods currently on the node will cause users to interpret or dashboard it as an instantaneous container count. Describe it as the cumulative number of containers across observed pod samples instead.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We faced the same confusion so it's worth clarifying per Codex's suggestion.

I think you should also adopt the metric's official description.

The number of containers per pod.

For updated descriptions:

The cumulative sum of the number of containers per pod.

and

The count of the number of containers per pod.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants