`rate()` vs `irate()`: what is the difference?

IntermediateConceptPromQL & Recording Rules
Answer
  • rate() uses all samples in the window and gives a smoothed average. Good for alerts, SLOs and most dashboards.
  • irate() uses only the last two samples in the window. It reacts instantly to spikes but is noisy, and at wide graph steps it skips most data (it shows whatever happened in the last scrape interval of each step).

Use irate only for zoomed-in, high-resolution graphs of fast-moving counters. Never alert on irate.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules