TL;DR: Threshold alerts ("error rate above 0.1%") page people for events that barely touch the error budget, and miss slow burns that quietly exhaust it. Burn-rate alerting measures how fast you are spending the error budget instead. Combine a long window (to be precise) with a short window (to reset quickly), run several burn rates at different severities, and you get alerts that fire in proportion to the damage. This article walks through the maths, a validated Prometheus rule set, the trade-offs, and the mistakes we see most often.

Why threshold alerts fail SLO-driven teams

Most on-call rotations inherit alerts written before anyone had an SLO. "5xx ratio above 1% for five minutes" is the classic. It feels safe, and it is wrong in two directions at once.

Google's SRE Workbook chapter on alerting on SLOs (Alerting on SLOs) gives a useful vocabulary for judging any alert:

  • Precision: the share of alerts that correspond to a significant event.
  • Recall: the share of significant events that produce an alert.
  • Detection time: how long it takes to notify you after the event starts.
  • Reset time: how long the alert keeps firing after the problem is over.

Run the common approaches through those four attributes. The Workbook walks through them using a 99.9% SLO:

  1. Alert when the error rate crosses the SLO threshold (for example >= 0.001). Detection is quick, but precision is low. The Workbook points out that a 0.1% error rate sustained for ten minutes would alert while consuming only 0.02% of the monthly budget.
  2. Lengthen the alert window (for example 36 hours). Precision improves, but reset time is very poor: after a total outage the alert can keep firing for around 36 hours.
  3. Add a for: duration. Detection and recall suffer, because the duration does not scale with severity. A 100% outage still waits an hour. The Workbook explicitly recommends against using durations in SLO-based alerting criteria, partly because the timer resets if the metric briefly dips back within SLO.
  4. Alert on a single burn rate. Precision and reset time are good, but recall is low: a service burning at 35x never trips a rule tuned for 36x.

The conclusion in the same chapter is that multiwindow, multi-burn-rate alerting is, in most cases, the most appropriate approach. The rest of this article shows how to build it.

Error budgets and burn rate in plain terms

An SLO of 99.9% over 30 days leaves an error budget of 0.1%. In time terms that is 43.2 minutes of complete unavailability (0.001 × 30 × 24 × 60). The Workbook defines burn rate as how fast, relative to the SLO, the service consumes the error budget. A burn rate of 1 exhausts the budget exactly at the end of the window. A burn rate of 2 exhausts it in half the window.

Three relationships are all you need:

  • Alert threshold = burn rate × (1 − SLO). For a 99.9% SLO and burn rate 14.4, that is an error ratio of 0.0144.
  • Budget consumed = burn rate × alert window ÷ SLO period. Burn rate 14.4 for one hour of a 720-hour period is 2%.
  • Time to exhaustion = SLO period ÷ burn rate. At a burn rate of 1,000 (a total outage on a 99.9% SLO) the 30-day budget is gone in 43.2 minutes.

Here is a small, dependency-free script you can run to check your own numbers before you write any rule. We ran it against the figures in this article:

python
"""Burn-rate arithmetic for an SLO. Pure stdlib."""
def budget_fraction(slo: float) -> float:
    return 1.0 - slo

def threshold(slo: float, burn_rate: float) -> float:
    """Error ratio at which the budget burns at `burn_rate`."""
    return burn_rate * budget_fraction(slo)

def budget_consumed(burn_rate: float, window_h: float, period_h: float = 720.0) -> float:
    """Share of the period's budget spent if burn_rate holds for window_h hours."""
    return burn_rate * window_h / period_h

def hours_to_exhaustion(burn_rate: float, period_h: float = 720.0) -> float:
    return period_h / burn_rate

if __name__ == "__main__":
    slo = 0.999
    print(f"30-day budget: {720*60*budget_fraction(slo):.1f} minutes of full outage")
    for name, br, win in [("page-fast", 14.4, 1), ("page-slow", 6, 6), ("ticket", 1, 72)]:
        print(f"{name:10s} burn={br:<5} window={win:>3}h "
              f"threshold={threshold(slo, br):.5f} consumed={budget_consumed(br, win):.0%}")
    print(f"100% outage exhausts budget in {hours_to_exhaustion(1000)*60:.1f} min at 1000x")

Running it prints 43.2 minutes of budget, thresholds of 0.01440, 0.00600 and 0.00100, and consumption of 2%, 5% and 10% for the three alert tiers used below.

The multi-window, multi-burn-rate pattern

The Workbook's recommended configuration for a 99.9% SLO uses three tiers (its Table 5-8):

SeverityLong windowShort windowBurn rateBudget consumed
Page1 hour5 minutes14.42%
Page6 hours30 minutes65%
Ticket3 days6 hours110%

Each row pairs a long window with a short window, and the alert fires only when both exceed the burn-rate threshold. The long window gives precision: it proves the problem has already cost a meaningful slice of budget. The short window gives a fast reset: once errors stop, the five-minute window recovers in about five minutes, instead of the alert lingering for the full hour. The Workbook's guideline is to make the short window one twelfth of the long window, which all three rows follow.

The three tiers also cover different failure shapes. A fast, severe outage trips the 14.4 rule within minutes. A moderate, sustained degradation never reaches 14.4 but trips the 6x rule within hours. A slow leak that would still exhaust the budget before the period ends is caught by the ticket rule, and nobody needs to be woken up for it.

mermaid
flowchart LR
    A[Request metrics<br/>total and errors] --> B[Recording rules<br/>error ratio per window]
    B --> C{Long AND short window<br/>above burn-rate threshold?}
    C -- 14.4x: 1h and 5m --> P1[Page]
    C -- 6x: 6h and 30m --> P2[Page]
    C -- 1x: 3d and 6h --> T[Ticket]
    P1 --> R[Alertmanager routing]
    P2 --> R
    T --> R
    R --> O[On-call / ticket queue]

A working Prometheus implementation

Evaluating a 3-day rate() on every rule evaluation is wasteful, so pre-compute the error ratio over each window with recording rules, then compare them in the alert expressions. The example below uses a hypothetical checkout job and a conventional http_requests_total counter with a code label. Substitute your own metric names and, if your SLO is not 99.9%, your own budget fraction (0.001 here).

yaml
groups:
  - name: slo-checkout-recording
    rules:
      - record: job:slo_errors_per_request:ratio_rate5m
        expr: |
          sum by (job) (rate(http_requests_total{code=~"5.."}[5m]))
          /
          sum by (job) (rate(http_requests_total[5m]))
      - record: job:slo_errors_per_request:ratio_rate30m
        expr: |
          sum by (job) (rate(http_requests_total{code=~"5.."}[30m]))
          /
          sum by (job) (rate(http_requests_total[30m]))
      - record: job:slo_errors_per_request:ratio_rate1h
        expr: |
          sum by (job) (rate(http_requests_total{code=~"5.."}[1h]))
          /
          sum by (job) (rate(http_requests_total[1h]))
      - record: job:slo_errors_per_request:ratio_rate6h
        expr: |
          sum by (job) (rate(http_requests_total{code=~"5.."}[6h]))
          /
          sum by (job) (rate(http_requests_total[6h]))
      - record: job:slo_errors_per_request:ratio_rate3d
        expr: |
          sum by (job) (rate(http_requests_total{code=~"5.."}[3d]))
          /
          sum by (job) (rate(http_requests_total[3d]))
  - name: slo-checkout-alerts
    rules:
      - alert: ErrorBudgetBurnPage
        expr: |
          (
            job:slo_errors_per_request:ratio_rate1h{job="checkout"} > (14.4 * 0.001)
            and
            job:slo_errors_per_request:ratio_rate5m{job="checkout"} > (14.4 * 0.001)
          )
          or
          (
            job:slo_errors_per_request:ratio_rate6h{job="checkout"} > (6 * 0.001)
            and
            job:slo_errors_per_request:ratio_rate30m{job="checkout"} > (6 * 0.001)
          )
        labels:
          severity: page
        annotations:
          summary: "checkout is burning its 30-day error budget too fast"
      - alert: ErrorBudgetBurnTicket
        expr: |
          job:slo_errors_per_request:ratio_rate3d{job="checkout"} > (1 * 0.001)
          and
          job:slo_errors_per_request:ratio_rate6h{job="checkout"} > (1 * 0.001)
        labels:
          severity: ticket
        annotations:
          summary: "checkout is on course to exhaust its error budget"

We parsed this file as valid YAML before including it. We did not run it against a live Prometheus here, so before you roll it out, run promtool check rules on it and use promtool test rules with synthetic series to prove each alert fires and resets as expected.

A few details worth noting:

  • The rules name the recording rules with the level:metric:operations convention that the Prometheus documentation recommends for recording rules.
  • Notice there is no for: clause. The windows already provide the damping that a duration would, and the Workbook cautions against durations for exactly this reason. If you do want an alert to stay resolved-looking for a while after the condition clears, Prometheus offers keep_firing_for (see the alerting rules documentation). Check the version of Prometheus you run supports it.
  • The Workbook's own ticket example also includes a 24-hour/2-hour pair at burn rate 3, which gives you a middle tier between the 6-hour page and the 3-day ticket. Add it if your team wants an earlier warning.
  • For a different SLO, only the budget fraction changes. At 99.95% the budget is 0.0005, so a burn rate of 14.4 corresponds to an error ratio of 0.0072.

Choosing burn rates and windows: the trade-offs

The numbers in the table are a starting point, not a law. The Workbook derives them from a simple policy: spend no more than a chosen share of the budget before a human is told. Pick your own policy, then compute the burn rate from it with the formulas above.

DecisionFaster detectionFewer pages
Burn rateLower (catches slower burns)Higher (only severe incidents)
Long windowShorterLonger
Short windowLonger (slower reset, steadier alerts)Shorter (faster reset)
Budget share consumed before pagingSmallerLarger
SLO periodShorter period spends budget fasterLonger period smooths noise

Two practical consequences follow. First, detection time and precision pull against each other: a lower consumed-budget share detects sooner but fires on smaller blips. Second, a short window that is too short makes alerts flap on noisy, low-volume metrics, so resist the urge to shrink it just to reset faster.

If you manage many services, the Workbook's "Alerting at Scale" section suggests applying one set of alerting parameters across services and grouping requests into a small number of criticality buckets rather than hand-tuning each service.

Low-traffic services need a different approach

Burn-rate maths assumes enough requests that a ratio is statistically meaningful. With ten requests an hour, a single failure is a 10% hourly error rate. On a 99.9% SLO the Workbook calls that a 1,000x burn rate that would page immediately, and notes that only about seven failed requests fit in a whole 30-day budget at that traffic level.

The Workbook's options for this situation:

  • Generate artificial traffic with synthetic probes. Be aware that if a fault affects real users but not your probe path, the healthy synthetic requests can hide the real signal.
  • Combine services that share a failure domain (a common database, for instance) so the ratio is computed over more requests.
  • Change the product or clients so more requests are needed for a single incident to count as a failure, for example by adding retries with exponential backoff and jitter or a fallback path.
  • Revisit the SLO or the window if the target does not match the real impact of a failure. This is a product decision, not just an engineering one.

Rolling this out without a pager storm

A migration plan that has worked for engineering teams:

  1. Inventory current alerts and tag each with the user-facing symptom it is meant to catch. Many will be cause-based (CPU, disk) and belong on dashboards or tickets.
  2. Write the SLO first. Agree on the SLI (good events over valid events), the target and the window with the product owner.
  3. Run burn-rate rules in shadow mode. Route them to a test receiver for two to four weeks and compare against the pages you actually received.
  4. Replay past incidents. Use promtool test rules or backfilled data to see when each rule would have fired and reset.
  5. Cut over and delete the old alerts. Keeping both guarantees duplicate pages and erodes trust in the new ones.
  6. Link every page to a runbook and to the dashboard showing remaining budget.
  7. Review monthly. Check precision (pages that needed action) and recall (incidents found by customers first) and adjust.

Common mistakes

  • Reusing the SLO error ratio for the wrong denominator. Counting health-check or bot traffic dilutes the ratio and delays alerts.
  • Putting for: back in. Teams add a five-minute duration "just in case", which reintroduces the problems described above.
  • Copying the 99.9% table onto a different SLO. The burn rates stay the same, but the error-ratio thresholds must be recomputed from the new budget.
  • Mismatched windows. The short window should be about a twelfth of the long one. A 1-hour long window with a 30-minute short window barely adds any reset benefit.
  • Missing label alignment. The and operator matches on labels. If the recording rules for different windows carry different labels, the alert silently never fires.
  • Alerting on the ticket tier by page. The slow-burn rule exists so nobody is woken at 3 a.m. for a problem that takes days to matter. Route it to a queue.
  • No testing. An untested rule is a hypothesis. Use promtool test rules.
  • Ignoring low-traffic services. One bad request should not page the whole team.

Implementation checklist

  • [ ] SLI defined as good events over valid events, agreed with the service owner
  • [ ] SLO target and window documented
  • [ ] Budget fraction and thresholds computed (the script above, or your own)
  • [ ] Recording rules for every window, with identical label sets
  • [ ] Page rules at 14.4x (1h/5m) and 6x (6h/30m); ticket rule at 1x (3d/6h)
  • [ ] No for: on burn-rate alerts
  • [ ] promtool check rules and promtool test rules pass in CI
  • [ ] Alertmanager routes severity: page to on-call, severity: ticket to the queue
  • [ ] Every alert links to a runbook and a budget dashboard
  • [ ] Shadow-run completed and old threshold alerts removed
  • [ ] Low-traffic services handled with probes, grouping or adjusted SLOs
  • [ ] Monthly review of precision and recall scheduled

Where Syslabs fits

Moving from threshold alerts to SLO-based alerting is mostly an engineering-discipline change: agreeing SLIs, standardising rules across services, wiring routing and runbooks, and testing in CI. Syslabs helps teams with cloud infrastructure design, DevOps and CI/CD pipelines and operational readiness, so alerting reflects what customers actually experience. If you would like a second pair of eyes on your alerting design or an SLO rollout plan, book a meeting.

References

  • Beyer, B., Murphy, N. R., Rensin, D., Kawahara, K., Thorne, S. (Eds.). The Site Reliability Workbook, Chapter 5, "Alerting on SLOs". Google / O'Reilly. https://sre.google/workbook/alerting-on-slos/
  • Prometheus Authors. "Alerting rules". Prometheus documentation. https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
  • Prometheus Authors. "Recording rules" and "Unit testing for rules". Prometheus documentation. https://prometheus.io/docs/prometheus/latest/configuration/recordingrules/ and https://prometheus.io/docs/prometheus/latest/configuration/unittesting_rules/

Ready to talk it through? Book a call: https://www.syslabs.in/book/meeting