Calculating Pod CPU usage on EKS Kubernetes cluster with Prometheus

21 views
Skip to first unread message

Darshan Deshmukh

unread,
Jul 16, 2020, 2:20:36 PM7/16/20
to Prometheus Users
Hi All,

I am calculating the percentage CPU usage with below expression -

sum(rate(container_cpu_usage_seconds_total{container_name="abc"}[5m])) by (container_name) /
sum(container_spec_cpu_quota{container_name="abc"}/container_spec_cpu_period{container_name="abc"}) by (container_name) *100

My goal is to get the actual CPU values so that I can do optimum allocation in resource requests.

Can someone provide me the Prometheus expression to calculate the CPU usage for currently running pod. (The goal is to monitor it for month to conclude on optimum allocation required to save the cost) 

Darshan Deshmukh
Mobile - 9404611164


Reply all
Reply to author
Forward
0 new messages