Skip to content

section: blog/slo-error-budgets-burn-rate-alerts

Error budgets in practice: alerting on burn rate instead of thresholds

How to turn an SLO into alerts that page on real user impact: error budgets, burn rates and the multi-window, multi-burn-rate pattern with PromQL examples.

published 2 min read

Threshold alerts such as error rate above 1% for five minutes are easy to write and hard to live with. They fire on short blips nobody would notice, and they stay quiet during a slow leak that quietly burns through a month of reliability. Alerting on error-budget burn rate ties pages directly to the SLO you have agreed with your users.

From SLO to error budget

An SLO of 99.9% successful requests over 30 days means 0.1% of requests may fail. That allowance is the error budget. Expressed as time, 0.1% of 30 days (43,200 minutes) is 43.2 minutes of complete unavailability — or a much longer period of partial failure.

Burn rate

Burn rate is how fast you are spending the budget relative to the SLO window. A burn rate of 1 uses the budget exactly at the end of the window. A burn rate of 14.4 sustained for one hour spends 14.4 / 720 hours = 2% of a 30-day budget, and would exhaust it entirely in about 50 hours.

burn ratetext
burn_rate      = observed_error_ratio / (1 - SLO)
time_to_empty  = SLO_window / burn_rate
budget_spent   = burn_rate × alert_window / SLO_window
Error budget left during the first 72 hours, by burn rateFor a 30-day SLO window: at burn rate 1 about 90% of the budget is left after 72 hours; at burn rate 6 about 40%; at burn rate 14.4 the whole budget is gone after 50 hours.0%50%100%0244872hoursbudget leftburn rate 1burn rate 6burn rate 14.4 · empty at 50 h
fig. 1Budget left during the first 72 hours of a 30-day window, from remaining = 1 − burn_rate × hours / 720.

Multi-window, multi-burn-rate alerts

The pattern popularised by the Google SRE Workbook combines a few burn-rate thresholds, each over a long window that makes the alert significant and a short window that makes it reset quickly once the problem is fixed. Common starting points for a 30-day SLO:

  • Page: burn rate 14.4 over 1 hour (short window 5 minutes) — 2% of budget spent.
  • Page: burn rate 6 over 6 hours (short window 30 minutes) — 5% of budget spent.
  • Ticket: burn rate 1 over 3 days (short window 6 hours) — 10% of budget spent.

Requiring both windows to exceed the threshold keeps precision high: the long window ignores brief spikes, and the short window stops the alert from firing for hours after recovery.

PromQL example

With recording rules for the error ratio at each window, the fast-burn page for a 99.9% SLO looks like this:

slo-alerts.rules.yamlyaml
groups:
  - name: api-slo
    rules:
      - record: job:slo_errors_per_request:ratio_rate1h
        expr: |
          sum by (job) (rate(http_requests_total{job="api",code=~"5.."}[1h]))
          /
          sum by (job) (rate(http_requests_total{job="api"}[1h]))
      - record: job:slo_errors_per_request:ratio_rate5m
        expr: |
          sum by (job) (rate(http_requests_total{job="api",code=~"5.."}[5m]))
          /
          sum by (job) (rate(http_requests_total{job="api"}[5m]))
      - alert: APIErrorBudgetFastBurn
        expr: |
          job:slo_errors_per_request:ratio_rate1h > (14.4 * 0.001)
          and
          job:slo_errors_per_request:ratio_rate5m > (14.4 * 0.001)
        labels:
          severity: page
        annotations:
          summary: "API is burning its 30-day error budget 14.4x too fast"

Practical notes

  • Low-traffic services make ratios noisy; consider synthetic traffic or longer windows.
  • Measure at the edge closest to the user (load balancer or gateway) so the SLI reflects what users see.
  • Review alert outcomes regularly: every page should have been worth waking up for.