what is the default grafana setting for $__rate_interval

2,646 views
Skip to first unread message

Devadrita Bose

unread,
May 25, 2022, 3:55:52 AM5/25/22
to Prometheus Users

I understand that rate(xyz[5m]) * 60 is the rate of xyz per minute, averaged over 5 mins.

  1. How then would $__rate_interval and $__interval be defined, possibly in the same syntax?
  2. What format is rate being measured here, in my panel? Per minute, per second?
  3. What is the interval= 30s in my panel here? My scraping interval is set to 5s.
  4. How do i change the rate format?Screenshot (11).png

Brian Candler

unread,
May 25, 2022, 8:14:42 AM5/25/22
to Prometheus Users
rate(xyz[$__rate_interval]) * 60

"interval" comes from the data source definition.  $__rate_interval is the higher of 4 x the data source's defined rate interval, or the spacing between adjacent points in the graph.

But really, questions about Grafana would be better asked on a Grafana mailing list.  See https://community.grafana.com/

Bjoern Rabenstein

unread,
May 25, 2022, 12:39:21 PM5/25/22
to Devadrita Bose, Prometheus Users
On 25.05.22 00:53, Devadrita Bose wrote:
>
>
> I understand that rate(xyz[5m]) * 60 is the rate of xyz per minute,
> averaged over 5 mins.
>
> 1. How then would $__rate_interval and $__interval be defined, possibly
> in the same syntax?

Does this blog post help? (Shameless plug...)
https://grafana.com/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/

> 2. What format is rate being measured here, in my panel? Per minute, per
> second?

It really depends on your panel resolution and width. Those variable
settings (coming from Grafana, not Prometheus, as Brian already hinted
at) itend to "cover all the data" rather than having an average over a
fixed period of time.

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Reply all
Reply to author
Forward
0 new messages