`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.
More on PromQL & Recording Rules
What are the PromQL data types?BeginnerWhat label matchers does PromQL support?BeginnerExplain `rate()`.BeginnerWhat does `increase()` return and why is it sometimes a non-integer?IntermediateWhy must you `rate()` before `sum()`, never the reverse?IntermediateHow do PromQL aggregation operators and `by`/`without` work?Beginner