Top 5 pods by CPU usage in a namespace?
BeginnerProductionRapid-Fire PromQL & LogQL
Answer
topk(5, sum by (pod) (rate(container_cpu_usage_seconds_total{namespace="shop", container!=""}[5m])))
container!="" removes the pod-level cgroup series that would double-count.
More on Rapid-Fire PromQL & LogQL
Requests per second per service over the last 5 minutes?BeginnerPercentage of 5xx responses per service?Beginnerp99 latency per route from a histogram?IntermediateMemory working set as a percentage of the container limit?IntermediateWhich scrape targets are down right now?BeginnerWhich filesystems will fill up within 4 hours?Intermediate