Get historical cpu usage using cadvisor.

187 views
Skip to first unread message

Pei Hsuan

unread,
Jul 26, 2018, 4:24:21 AM7/26/18
to Prometheus Users
Hi,
I wondering how to use the metrics from cadvisor to plot the cpu usage history of an container.

I know I can use 
rate(container_cpu_usage_seconds_total[1m])
to get the average cpu usage base on the data in past 1 minute.

But how to get the historical cpu usage not just the current one?

Simon Pasquier

unread,
Jul 26, 2018, 4:37:13 AM7/26/18
to Pei Hsuan, Prometheus Users
Use a range query instead of an instant query.
In the Prometheus Graph UI, you do it by clicking the Graph tab (instead of Console).

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/6e5adf18-1fd0-4388-98b8-d2ea932a419f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pei Hsuan

unread,
Jul 26, 2018, 6:01:08 AM7/26/18
to Prometheus Users
Really thank to you reply!

Simon Pasquier於 2018年7月26日星期四 UTC+8下午4時37分13秒寫道:
Use a range query instead of an instant query.
In the Prometheus Graph UI, you do it by clicking the Graph tab (instead of Console).
On Thu, Jul 26, 2018 at 10:24 AM, Pei Hsuan <c207...@gmail.com> wrote:
Hi,
I wondering how to use the metrics from cadvisor to plot the cpu usage history of an container.

I know I can use 
rate(container_cpu_usage_seconds_total[1m])
to get the average cpu usage base on the data in past 1 minute.

But how to get the historical cpu usage not just the current one?

--
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 post to this group, send email to promethe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages