Counter Rates & Increases
Learn how Prometheus handles counter resets with rate, irate, and increase functions.
Counter Resets
Counter metrics can reset to zero when a scraped process restarts (e.g., the server is restarted). Counter functions automatically handle counter resets by assuming that any decrease in a counter value was a reset. Internally, these functions compensate for the reset by adding the last sample value before the reset to all sample values after the reset.

Counter Functions
Rate
rate()
- "rate of increase" - calculates a per-second increase of a counter as averaged over a specified window.
iRate
irate()
- "instantaneous rate of increase" - calculates a per-second increase over the time window, only considering the last 2 points.
Increase
increase()
- "absolute increase" - calculates the absolute increase over a given time value, including extrapolation.
Last updated
Was this helpful?