Skip to main content...
Observability: Metrics, Logs, Traces
20 min

Day 100: Prometheus recording rules and Alertmanager

Recording rules: precomputing expensive queries

A dashboard re-running a complex aggregation query every few seconds, for every viewer, is wasteful. A recording rule precomputes a query on a schedule and saves the result as a new time series — dashboards and alerts then query the cheap, precomputed series instead.

A recording rule
groups:
  - name: api_rules
    rules:
      - record: api:error_rate:5m
        expr: sum(rate(http_requests_total{status=~'5..'}[5m])) / sum(rate(http_requests_total[5m]))

Alertmanager

Prometheus evaluates alert rules and fires alerts; Alertmanager is a separate component handling what happens next — deduplicating identical alerts, grouping related ones into a single notification, routing to the right channel (Slack, PagerDuty) based on labels, and silencing/inhibiting alerts you already know about (e.g. suppress "API down" if "cluster down" is already firing).

Why grouping and inhibition matter so much

Without them, one real incident (a node dying) can trigger dozens of individually-firing alerts (every service on that node, every dependent check) — alert fatigue that trains on-call engineers to ignore pages. This is the tooling side of Phase 18's 'alert design: symptoms, not causes' principle.

Key terms

Recording rule
A precomputed, scheduled query saved as its own time series.
Alertmanager
Deduplicates, groups, routes, and silences alerts fired by Prometheus.

A single node failure triggers 40 individual alerts from 40 affected services. What Alertmanager feature addresses this specific problem?

We use cookies

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Learn more

    Day 100: Prometheus recording rules and Alertmanager | RBTechIconX