Pod level cpu usage metrics

22 views
Skip to first unread message

Manish G

unread,
Sep 1, 2020, 7:32:59 AM9/1/20
to promethe...@googlegroups.com
Hi All,

I want to display pod cpu usage graph for my application running in kubernetes. I want to show the graph for CPU usage at a given time, like what we have in visual vm.
Metrics I see available is container_cpu_usage_seconds_total. But this is a counter.
It doesn't suit my usecase as cpu usage can go up and down.

Is there any other suitable metrics available?

With regards

Matthias Rampke

unread,
Sep 1, 2020, 7:35:10 AM9/1/20
to Manish G, Prometheus Users
CPU usage counters represent the CPU time spent in seconds. You can get the CPU usage (time spent in seconds, per second) by using the rate function:

rate(container_cpu_usage_seconds_total[1m])

/MR

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAOFd6ihj9rFsmDa7AWWXsAaMFO7E0BVvZwaFA6oHsEr6EfeM%2BA%40mail.gmail.com.

Prashant Singh

unread,
Sep 4, 2020, 1:42:45 AM9/4/20
to promethe...@googlegroups.com
Hi, 

We want to monitor pod restart  or what is Promql for pod restart. 

Prometheus version :2.19.3

Grafana version 7.0.3
Reply all
Reply to author
Forward
0 new messages