cpu used

31 views
Skip to first unread message

BHARATH KUMAR

unread,
Mar 2, 2022, 4:48:45 AM3/2/22
to Prometheus Users
Hello All,

If the scrape interval is 15 seconds I am able to see CPU used in the  GRAFANA dashboard. but if the scrape interval is 2 minutes I am not able to see CPU used in the  GRAFANA dashboard. what could be the reason behind that?

and we can set scrape interval at max 2 minutes right? then why I am unable to see CPU used in GRAFANA dashboard

Brian Candler

unread,
Mar 2, 2022, 7:12:49 AM3/2/22
to Prometheus Users
Probably because the dashboard query is using a rate with a fixed interval, e.g.
    rate(foo[2m])
This won't work with a scrape interval of 2m, because the 2m time range only includes one data point, and at least two data points are required to calculate a range.

Firstly, change the query to:
    rate(foo[$__rate_interval])

Then go to Grafana settings, Prometheus data source, and configure the actual scrape interval you are using.

$__rate_interval returns the larger of:
* 4 times the configured scrape interval; or
* the configured scrape interval plus the interval between points on the graph (when zoomed out a long way)

Reply all
Reply to author
Forward
0 new messages