Skip to main content

SLOs · Alerting · Prometheus

Burn Rate Alerts: Multi-Window, Multi-Burn-Rate SLO Alerting

Threshold alerts page on blips and miss slow leaks. How multi-window burn rate alerts work, the math behind 14.4x and 6x, and PromQL rules you can adapt.

aiAxonIQ Team, Engineering at aiAxonIQ

Nov 16, 20269 min read

A threshold alert on error rate asks the wrong question. "Errors above 1% for 5 minutes" pages on a short blip that cost almost nothing, and stays quiet through a 0.5% leak that eats the month's error budget in a week. Burn rate alerts ask the question the SLO actually cares about: at the current rate of failure, how fast is the budget disappearing, and is that fast enough that a human should act now?

This guide works through the multi-window, multi-burn-rate approach from the "Alerting on SLOs" chapter of the Google SRE Workbook: the math behind the standard 14.4x, 6x and 1x thresholds, Prometheus recording rules and alert rules you can adapt, and the reason every alert pairs a long window with a short one. If SLI, SLO and error budget are still fuzzy terms, start with SLO vs SLA vs SLI.

What a burn rate is

An SLO of 99.9% over 30 days gives an error budget of 0.1% of requests in that window. Burn rate is the ratio between the error rate you are seeing and the error rate the budget allows:

burn_rate = observed_error_ratio / (1 - SLO)

SLO 99.9%                 -> budget ratio 0.001
observed error ratio 0.5% -> burn rate 0.005 / 0.001 = 5

A burn rate of 1 spends exactly the whole budget by the end of the SLO window. A burn rate of 2 spends it in half the window, and in general a sustained burn rate of b exhausts a 30-day budget in 30 / b days. At 14.4x that is 50 hours. At 6x it is five days.

Burn rate also has a ceiling. If every request fails, the error ratio is 1 and the burn rate is 1 / (1 - SLO): 1,000 for 99.9%, 100 for 99%, 10 for 90%. That matters later. A 14.4x threshold on a 90% SLO can never fire, because the service cannot burn faster than 10x.

From budget consumed to a threshold

The useful way to pick a threshold is backwards from a decision: "page someone if we have spent 2% of the monthly budget in the last hour." Convert that to a burn rate with:

burn_rate = (budget_fraction * slo_period) / alert_window

2%  in 1h:  0.02 * 720h / 1h  = 14.4
5%  in 6h:  0.05 * 720h / 6h  = 6
10% in 3d:  0.10 * 720h / 72h = 1

Those three rows are the Workbook's recommendation for a 30-day SLO, and they cover the cases that matter:

  • 14.4x over 1 hour, short window 5 minutes: page. 2% of the budget gone in an hour. Left alone, the whole budget is gone in about two days.
  • 6x over 6 hours, short window 30 minutes: page. 5% of the budget in six hours. Slower, but it still burns the month in five days.
  • 1x over 3 days, short window 6 hours: ticket. 10% of the budget in three days. Nobody needs waking up, but at this rate the window ends with nothing left.

The numbers depend on the SLO period. For a 28-day window the same budget fractions give 13.44x, 5.6x and 0.93x. Many teams keep 14.4 and 6 for simplicity, which is fine as long as you know the alert now means slightly more than 2% of the budget.

Multiply the burn rate by the budget ratio to get the error ratio the alert compares against. For 99.9%, the fast-burn page fires above a 1.44% error ratio, the slow-burn page above 0.6%, and the ticket above 0.1%. For a full outage, the fast-burn condition is met in under a minute: 1h times 14.4 times 0.001 is 0.0144 hours, about 52 seconds of total failure.

Why one window is not enough

Each long window answers "is this significant?" A 1-hour window at 14.4x only fires once 2% of the budget is actually spent, so a 30-second blip of errors does not page anyone. The problem is what happens after the incident ends.

Suppose checkout fails every request for 10 minutes and then recovers. The 1-hour error ratio climbs to about 16.7%, far over the 1.44% threshold, and the alert fires within the first minute. After recovery, the 1-hour ratio only falls back under 1.44% when nearly all of those bad minutes have aged out of the window, which takes close to an hour. The alert stays open after the fix is out, so it cannot tell you whether the fix worked, and a second problem in that hour arrives as an alert that is already firing. The 3-day ticket is worse: a single bad afternoon keeps it open for days.

The short window fixes this. Each rule requires both windows to exceed the same threshold:

fire if  error_ratio(1h) > 14.4 * 0.001
    AND  error_ratio(5m) > 14.4 * 0.001

The long window still guarantees the burn is significant. The short window, one twelfth of the long one, checks that it is still happening. Once errors stop, the 5-minute ratio drops below the threshold within about five minutes and the alert resolves, even though the 1-hour ratio is still high. Detection time barely changes, because during an active incident the short window crosses the threshold before the long one does.

Prometheus recording rules

Computing a 3-day error ratio from raw counters on every evaluation is expensive. Record the ratio once per window and build the alerts on the recorded series. The example assumes the OpenTelemetry HTTP server duration histogram, exported to Prometheus as http_server_request_duration_seconds, and counts 5xx responses as errors. Swap in your own counters and labels.

groups:
  - name: slo-checkout-ratios
    rules:
      - record: job:slo_errors_per_request:ratio_rate5m
        expr: |
          sum by (job) (rate(http_server_request_duration_seconds_count{job="checkout", http_response_status_code=~"5.."}[5m]))
          /
          sum by (job) (rate(http_server_request_duration_seconds_count{job="checkout"}[5m]))
      - record: job:slo_errors_per_request:ratio_rate30m
        expr: |
          sum by (job) (rate(http_server_request_duration_seconds_count{job="checkout", http_response_status_code=~"5.."}[30m]))
          /
          sum by (job) (rate(http_server_request_duration_seconds_count{job="checkout"}[30m]))
      # Repeat with [1h], [6h] and [3d], recording ratio_rate1h, ratio_rate6h, ratio_rate3d.

Two details matter. First, the ratio is a ratio of sums: total errors over total requests across every instance. Averaging per-instance ratios weights a quiet instance the same as a busy one and gives the wrong answer. Second, the windows you need are 5m, 30m, 1h, 6h and 3d. The 6h ratio does double duty, as the long window of the slow page and the short window of the ticket.

For a latency SLO the "errors" are slow requests. With a histogram, that is total requests minus the requests in the bucket at your threshold:

(
  sum by (job) (rate(http_server_request_duration_seconds_count{job="checkout"}[1h]))
  -
  sum by (job) (rate(http_server_request_duration_seconds_bucket{job="checkout", le="0.25"}[1h]))
)
/
sum by (job) (rate(http_server_request_duration_seconds_count{job="checkout"}[1h]))

The le value has to be a bucket boundary the histogram actually has. If the SLO says 300ms and the buckets jump from 250ms to 500ms, change the buckets or the SLO. Prometheus cannot count requests under a boundary that does not exist.

Alert rules

With the ratios recorded, the alerts are short. This follows the structure of the Workbook's example for a 99.9% SLO:

groups:
  - name: slo-checkout-alerts
    rules:
      - alert: CheckoutErrorBudgetBurn
        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"
          runbook_url: "https://runbooks.example.com/checkout/error-budget-burn"
      - alert: CheckoutErrorBudgetBurnSlow
        expr: |
          job:slo_errors_per_request:ratio_rate3d{job="checkout"} > 0.001
          and
          job:slo_errors_per_request:ratio_rate6h{job="checkout"} > 0.001
        labels:
          severity: ticket
        annotations:
          summary: "checkout will exhaust its error budget before the window ends"

Notes on the rules:

  • No `for:` clause. The long window already provides the persistence a for: would add. Putting for: 5m on top delays a fast-burn page by five minutes for no gain.
  • `and` matches on labels, ignoring the metric name. Both sides carry job="checkout", so they pair up. If the recording rules aggregate by different labels, the and silently returns nothing, so keep the by clause identical across every window.
  • Severity is routing. The two page conditions go to the on-call pager and the ticket goes to the team queue. The Workbook's example also adds a ticket at 3x over 24 hours with a 2-hour short window, if you want medium-speed leaks caught before the 3-day rule sees them.
  • Generate the thresholds from the SLO. Hand-editing 0.001 into a dozen rules is how a team ends up alerting on 99.9% for a service whose target moved to 99.5% last quarter. Tools such as Sloth and Pyrra generate multi-window rules from an SLO definition.

Low-traffic services

Burn rate alerts assume enough requests that a ratio means something. At 120 requests an hour, two failures put the 1-hour error ratio at 1.67%, over the 1.44% threshold, and if one of them landed in the last 5 minutes the short window is at roughly 10%. Two failed requests page someone at night.

The Workbook's options are to generate synthetic traffic so the denominator is steady, to combine several small services into one monitored group, to change the service so a single failure matters less (client retries, for example), or to accept a lower SLO or a longer window. A cheap guard you can add yourself is a minimum request count, so the alert cannot fire on a handful of requests:

(
  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)
)
and on (job)
sum by (job) (increase(http_server_request_duration_seconds_count{job="checkout"}[1h])) > 500

Pick the minimum deliberately. Everything below it is traffic you have decided not to page on, so it should be small enough that a total outage during a quiet hour still clears it.

Check the alerts before they page

Before routing a new burn rate alert to the pager, graph the alert expression over the last 30 days. Every interval where it returns a value is a page you would have received. Compare that list against your incident history: each real incident should appear, and each extra firing should be something you agree deserved a human. If the slow page fires on every Monday deploy, the fix is usually in the SLI (excluding health checks, counting client 4xx as good) rather than the threshold. For the wider question of what earns a page at all, see reducing alert fatigue.

Burn rate alerts in aiAxonIQ

Alerting in aiAxonIQ includes multi-window SLO burn-rate rules for fast and slow burns, alongside threshold, anomaly, absence and composite rules, routed to Slack, PagerDuty, OpsGenie, Microsoft Teams, email or webhooks. The SLOs behind them live in SLOs & Error Budgets: availability, latency, error-rate or custom-query SLIs on 7, 14, 28 or 90-day windows, computed from the traces and metrics you already send, with live remaining-budget views. The math in this guide is the same; you define the target and the window instead of maintaining recording rules by hand.

Checklist

  • Express each alert as budget consumed over a window, then convert it to a burn rate for your SLO period.
  • Pair every long window with a short window one twelfth its length, so alerts resolve when the burn stops.
  • Page on 14.4x over 1h and 6x over 6h; ticket on 1x over 3d.
  • Record ratios of sums per window, and keep the aggregation labels identical.
  • Check that the burn rate threshold is reachable: it must be below 1 / (1 - SLO).
  • Guard low-traffic services with synthetic traffic, grouping or a minimum request count.
  • Replay 30 days of history before the alert reaches the pager.

Put this into practice with aiAxonIQ Alerting.

More articles