Why use $__rate_interval instead of a fixed range like [5m] in Grafana?
⚡
Quick Answer
$__rate_interval scales the rate window with the dashboard's time range and scrape interval, avoiding gaps or over-smoothing.
Detailed Answer
A hard-coded [5m] breaks when zoomed out (too few points) or in (aliasing). $__rate_interval is computed by Grafana from the panel's step and the data source's scrape interval, guaranteeing at least a few samples per window at any zoom level. It's the recommended default for rate()/irate() in Grafana panels.
💡
Interview Tip
This is a common gotcha — mention it proactively.
grafanapromqlrate-interval