Prometheus and PromQL 3 · Configuration, rules and alerts

Precompute an expensive query

A recording rule stores a query's result as a new metric, so dashboards stay fast.

groups:
  - name: api-rules
    rules:
      - record: job:http_requests:rate5m
        expr: sum by (job) (rate(http_requests_total[5m]))

Official Prometheus and PromQL 3 documentation

More configuration, rules and alerts commands

All configuration, rules and alerts commands · Prometheus and PromQL 3 cheatsheet

Was this page helpful?