← All notes

PromQL rate(), irate() and increase() turn counters into per-second rates or totals

Answer: Use rate(counter[5m]) for the per-second average rate of increase over a range, irate() for the per-second instant rate based on the last two data points, and increase() for the total increase in the range. Each of them should only be used with counters.

Examples

rate(http_requests_total{job="api-server"}[5m])
irate(http_requests_total{job="api-server"}[5m])
increase(http_requests_total{job="api-server"}[5m])

How they behave

Gauges are different

idelta should only be used with gauges. Elements that mix float samples and histogram samples in the range are omitted from the result and flagged by a warn-level annotation.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Prometheus docs, Query functions; prometheus/prometheus (GitHub), Query functions (source page). Apache-2.0 (https://raw.githubusercontent.com/prometheus/prometheus/main/LICENSE). Copyright The Prometheus Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Prometheus docs, Query functions; prometheus/prometheus (GitHub), Query functions (source page). Apache-2.0 (https://raw.githubusercontent.com/prometheus/prometheus/main/LICENSE). Copyright The Prometheus Authors.

Cite this

Permanent ID: iil:note:czkzn09z

iinventedlight. 2026. "PromQL rate(), irate() and increase() turn counters into per-second rates or totals." iinventedlight Library, iil:note:czkzn09z, version of 2026-11-18. https://iinventedlight.com/library/notes/prometheus-rate-increase/. License: CC-BY-4.0.

@misc{iil_note_czkzn09z,
  author = {{iinventedlight}},
  title = {{PromQL rate(), irate() and increase() turn counters into per-second rates or totals}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/prometheus-rate-increase/},
  note = {Permanent ID iil:note:czkzn09z. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/prometheus-rate-increase.md.