`sum(rate(container_cpu_usage_seconds_total[5m]))` is double what `kubectl top` shows
IntermediateTroubleshootingPromQL and recording rules
Answer
Likely causes → cAdvisor exposes pod-level cgroup series (container="") and the pause container (container="POD") alongside each container.
Diagnose →
count by (container) (container_cpu_usage_seconds_total{namespace="shop"})
Fix →
sum by (namespace, pod) (rate(container_cpu_usage_seconds_total{container!="", container!="POD", image!=""}[5m]))
Prevent → Use the kube-prometheus recording rules (node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate5m).
More on PromQL and recording rules
A PromQL query in the UI returns `Empty query result` for a metric you can see on `/metrics`Beginner`rate(http_requests_total[1m])` returns nothing but `http_requests_total` has dataBeginner`rate()` applied to a gauge shows huge spikesBeginnerBinary operation fails: `many-to-many matching not allowed: matching labels must be unique on one side`Advanced`found duplicate series for the match group {pod="api-1"} on the right hand-side of the operation`IntermediateError ratio query returns no data during quiet hoursIntermediate