What is `$__rate_interval` in Grafana and why use it over a fixed `[5m]`?

IntermediateConceptPromQL & Recording Rules
Answer

$__rate_interval is a Grafana variable equal to max($__interval + scrape interval, 4 x scrape interval). It guarantees that the range in rate() always contains enough samples, no matter how far you zoom out, and avoids gaps at small ranges.

sum(rate(http_requests_total[$__rate_interval]))

Set the datasource's "Scrape interval" correctly for it to work.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules