Counter functions
Counter functions read monotonically increasing metrics — request totals, bytes sent — and turn raw counts into rates and increases while handling counter resets.
increase
irate
Computes the per-second rate using only the last two samples in the range window. irate reacts instantly to change, at the cost of volatility — suited to zoomed-in debugging graphs, not alerts.
rate
Computes the per-second average rate of increase of a counter over the range window, handling counter resets. This is the default way to chart any _total metric and the basis of most alerts.
Parameters
| Parameter | Required | Description |
|---|---|---|
|
Required |
The trailing window to compute over, such as |
Example
Measure how fast the Kloudfuse ingester consumes Kafka batches.
sum(rate(ingester_kafka_batch_length_count[5m]))
| Value |
|---|
208,927.21 |
|
Use a range of at least 2–4× the scrape interval; shorter windows see too few samples. For gauges, use |
resets
Counts how many times a counter reset (dropped to a lower value) within the range window. Resets usually mean process restarts — a cheap restart detector from any counter you already collect.