Reputation:
How to modify the promql query to get the sum of all the pods (replicas) CPU usage belonging to one particular service?
To get the CPU usage of a single pod I use the following query :
rate(container_cpu_usage_seconds_total{pod="pod name",container="container name"}[5m]) by (container)
How can I modify this?
Upvotes: 1
Views: 1984
Reputation: 362
You can use sum(rate(container_cpu_usage_seconds_total{pod="pod name",container="container name"}[5m])) by (container)
to get the sum of all the pods (replicas) CPU usage belonging to one particular service.
Upvotes: 1