You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
empty container field gives 2x sum in container_cpu_usage_seconds_total #2688
We have some grafana charts from promethus that look like:
sum(irate(container_cpu_usage_seconds_total{pod=~"name-.*"}[2m])) by (pod)
However, we noticed after a recent upgrade to GKE v1.17.9-gke.1504 (from 1.16) that resources seemed to spike, and it turns out that in addition to an entry for each container, there is matching entry with container undefined, which appears to be the sum of the actual containers, so our charts started reporting always ~2x the 'real' usage. Is there a recommended fix for this, or do we need to manually add ,container!="" to all of our queries to get accurate sums? Or am I misinterpreting what the undefined-container entry is?
The missing-container results are always missing container, image, name keys and are otherwise identical to the 'real' metrics.
Our prometheus is public, so you can see the results here.
I didn't find this exact issue searching for it, but happy for a close & link if this turns out to be a duplicate.
Reacted by Tangyi, Matt Woodson, Julian Waibel and Bernardo García
We have the exact same issue and I'm so surprised this isn't more recognised as a problem. It's caused double counting on any of our container metrics.
Oddly ours only start displaying 12 hours in the past (metrics now aren't affected, but metrics older than 12 hours are)
If I've misunderstood the metrics, that would be great, but as it appears, these metrics appear to just be counted twice, so any sums, etc. will get the wrong result.
Is this true for all versions of cAdvisor? We have one cluster (OpenShift) where we see POD as the value for the container label but in the vast majority of our other clusters, it appears that container is just empty/not-set.
This issue is stale because it has been open 90 days with no activity. This issue will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.
Activity
minrk commentedon Oct 2, 2020
FWIW, container_memory_rss and presumably all container_ metrics are affected.
paulfantom commentedon Oct 2, 2020
You need to add
container!="POD"to your query.You can look at kubernetes-mixin project to get ready to use dashboards and alerts which are tested by others. Generated YAMLs can be obtained from https://monitoring.mixins.dev/kubernetes/
inetkiller commentedon Jul 29, 2022
I also have the same problem
fleetwoodstack commentedon Nov 22, 2023
We have the exact same issue and I'm so surprised this isn't more recognised as a problem. It's caused double counting on any of our container metrics.
Oddly ours only start displaying 12 hours in the past (metrics now aren't affected, but metrics older than 12 hours are)
sidewinder12s commentedon Feb 27, 2024
This also ends up blowing up cardinality and metric series at scale, which is a major problem with almost all metrics providers.
dims commentedon Dec 9, 2025
Closing this issue as it has been open since before January 1, 2024. If this is still relevant, please feel free to reopen or create a new issue.
minrk commentedon Dec 10, 2025
@dims please reopen, I don't have permission to do that.
I just checked and this issue persists in GKE
1.33.5-gke.1162000. It took no time or effort.It would be awesome if folks wouldn't waste so much time by closing persistent problems just because maintainers don't have time to fix them.
Try the query:
If I've misunderstood the metrics, that would be great, but as it appears, these metrics appear to just be counted twice, so any sums, etc. will get the wrong result.
elatt commentedon Jan 30, 2026
Is this true for all versions of cAdvisor? We have one cluster (OpenShift) where we see
PODas the value for thecontainerlabel but in the vast majority of our other clusters, it appears thatcontaineris just empty/not-set.github-actions commentedon May 1, 2026
This issue is stale because it has been open 90 days with no activity. This issue will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.
github-actions commentedon May 31, 2026
This issue was automatically closed due to inactivity.
feat(grafana-alloy): enable cAdvisor scoped to Network I/O metrics on…