Skip to content

Tools

Error budget and burn-rate calculator

Turn an SLO into allowed downtime, a burn rate, and the multiwindow alerts from the SRE workbook.

An SLO is a choice about how much failure you'll allow. This page turns that choice into a budget, shows how fast you're spending it, and drafts the multiwindow burn alerts from theSRE workbook. It runs in your browser. Nothing you type is sent anywhere.

The policy around the number is in theSLO and error budget primer. Spare capacity is the other budget: thezone-loss calculatorshows what losing a failure domain does to CPU, and what that headroom costs. The formulas are below the calculator.

SLO and window

Enter 99.9 for a 99.9% target. 100% has no budget.

Window

28 and 30 days are the usual rolling windows. A calendar month changes length, so it isn't a preset.

Leave this blank for a time budget only. Add it when the SLI is a ratio of requests.

How fast it's burning

1.44 means 1.44% of requests are bad. On a 99.9% SLO that's a 14.4× burn.

Used with budget spent. This is the average burn so far, not the error rate you're seeing right now.

Budget

A 99.9% SLO over 30 days allows 43.2 minutes of downtime. That's 0.1% of the window.

Allowed downtime

43.2 minutes

43 minutes, 12 seconds

Error budget

0.1%

of 30 days

Bad requests

Not set

Add a request rate for a bad-request budget.

From the error rate

Enter an observed error rate to see the current burn.

From budget already spent

Enter the percent of the budget you've spent, and how much of the window has elapsed.

Multiwindow burn alerts

These follow Table 5-8 in the workbook's alerting chapter. The page fires when 2% of the budget would be spent in an hour, or 5% in six hours. The ticket fires at 10% in three days. Each one also has to be burning over a short window, one twelfth as long, so a blip doesn't page and the alert clears when the short window recovers. The burn rate below is that budget share scaled to your window.

Burn-rate alert thresholds for the SLO and window above
AlertLong windowShort windowBurn rateBudget spentError rateFull budget lasts
PageFast page
1 hour5 minutes14.4×2%1.44%2.08 days (50 hours)
PageSlow page
6 hours30 minutes6×5%0.6%5 days (120 hours)
TicketSlow ticket
3 days6 hours1×10%0.1%30 days

Prometheus rules

Recording rules for the error ratio, then an alert for each row above. Both windows have to be over the threshold. Replace the selectors with your SLI before you paste this. A latency SLI is the same shape: slow requests over valid requests.

The window is appended, so this becomes …rate5m.

# 99.9% SLO over 30 days. Error budget is 0.1% (43.2 minutes).
# Multiwindow, multi-burn-rate alerts, from the SRE Workbook chapter "Alerting on SLOs".
# A burn rate of 1 exhausts the budget at the end of the window. The short window is 1/12 of the long window.
# Replace the selectors with your SLI. A latency SLI uses the same shape: slow requests over valid requests.
groups:
  - name: slo-burn-rate
    rules:
      - record: job:slo_errors_per_request:ratio_rate5m
        expr: |
          sum(rate(http_requests_total{job="myjob",code=~"5.."}[5m]))
          /
          sum(rate(http_requests_total{job="myjob"}[5m]))
      - record: job:slo_errors_per_request:ratio_rate30m
        expr: |
          sum(rate(http_requests_total{job="myjob",code=~"5.."}[30m]))
          /
          sum(rate(http_requests_total{job="myjob"}[30m]))
      - record: job:slo_errors_per_request:ratio_rate1h
        expr: |
          sum(rate(http_requests_total{job="myjob",code=~"5.."}[1h]))
          /
          sum(rate(http_requests_total{job="myjob"}[1h]))
      - record: job:slo_errors_per_request:ratio_rate6h
        expr: |
          sum(rate(http_requests_total{job="myjob",code=~"5.."}[6h]))
          /
          sum(rate(http_requests_total{job="myjob"}[6h]))
      - record: job:slo_errors_per_request:ratio_rate3d
        expr: |
          sum(rate(http_requests_total{job="myjob",code=~"5.."}[3d]))
          /
          sum(rate(http_requests_total{job="myjob"}[3d]))
      - alert: SLOBurnRatePageFast
        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: Page, 14.4x over 1h and 5m (2% of the 30-day budget)
          description: >-
            Both the 1h and 5m error ratios are above 1.44%.
            If that holds for the long window, it spends about 2% of the error budget.
            A steady burn at this rate exhausts a full budget in 2.08 days (50 hours).
      - alert: SLOBurnRatePageSlow
        expr: |
          (
              job:slo_errors_per_request:ratio_rate6h > (6 * 0.001)
            and
              job:slo_errors_per_request:ratio_rate30m > (6 * 0.001)
          )
        labels:
          severity: page
        annotations:
          summary: Page, 6x over 6h and 30m (5% of the 30-day budget)
          description: >-
            Both the 6h and 30m error ratios are above 0.6%.
            If that holds for the long window, it spends about 5% of the error budget.
            A steady burn at this rate exhausts a full budget in 5 days (120 hours).
      - alert: SLOBurnRateTicketSlow
        expr: |
          (
              job:slo_errors_per_request:ratio_rate3d > (1 * 0.001)
            and
              job:slo_errors_per_request:ratio_rate6h > (1 * 0.001)
          )
        labels:
          severity: ticket
        annotations:
          summary: Ticket, 1x over 3d and 6h (10% of the 30-day budget)
          description: >-
            Both the 3d and 6h error ratios are above 0.1%.
            If that holds for the long window, it spends about 10% of the error budget.
            A steady burn at this rate exhausts a full budget in 30 days.

Severity labels are page and ticket, matching the workbook. Change them if your routing expects critical and warning. The rules use sum(rate()) without a by clause, so add a label matcher if one rule group covers more than one service.

The math

An SLO of 99.9% says 0.1% of the window may be bad. That 0.1% is the error budget.

budget fraction = (100 − SLO percent) / 100
allowed downtime = window × budget fraction
allowed bad requests = requests in the window × budget fraction

A 99.9% target over 30 days:

30 × 24 × 60 = 43,200 minutes
43,200 × 0.001 = 43.2 minutes

43.2 minutes is the full outage you can spend if "down" means nobody can use the service. If the SLI is a ratio of requests, the budget is a count. At 100 requests a second over those 30 days, the window holds 259,200,000 requests and the budget is 259,200 bad ones.

A burn rate of 1, held constant, uses the budget exactly at the end of the window. Faster than that, and the budget runs out early.

burn rate = error rate / budget fraction
time to exhaust a full budget = window / burn rate

A 14.4× burn on a 30-day window exhausts the budget in 30 / 14.4 days, which is 2.08 days, or 50 hours. The error rate that produces it is 14.4 × 0.1% = 1.44%. A total outage is a 1,000× burn on this SLO, because 100% / 0.1% = 1,000, and it exhausts the budget in 43.2 minutes. The SRE workbook rounds that line to 43 minutes.

If you already know how much of the budget is gone:

burn rate = (fraction of budget spent) / (fraction of window elapsed)
time left = (budget remaining / burn rate) × window

Spending 2% of the budget in one hour is a 14.4× burn on a 30-day window, because 2% × (30 days / 1 hour) = 14.4. The same 2% in one hour is a 3.36× burn on a 7-day window. The clock time to exhaust a full budget stays 50 hours either way. What changes is how fast that is relative to the window you chose.

Why the alerts use two windows

The thresholds follow Table 5-8 in Alerting on SLOs. A page or a ticket fires only when the burn shows up over a long window and a short one. The short window is 1/12 of the long window, so one noisy minute doesn't page, and the alert stops once the short window drops back under the line.

For a 30-day window the starting set is:

  • Page at 14.4× over 1 hour and 5 minutes. That's 2% of the budget in an hour.
  • Page at 6× over 6 hours and 30 minutes. That's 5% of the budget in six hours.
  • Ticket at 1× over 3 days and 6 hours. That's 10% of the budget in three days.

The calculator keeps those clock windows and budget shares, then recomputes the burn rate for the window you picked:

alert burn rate = budget share × (SLO window / long window)
error ratio that fires = alert burn rate × budget fraction

The chapter's Prometheus example also ORs in a faster ticket, 3× over 1 day and 2 hours, which spends about 10% of a 30-day budget in a day. Table 5-8 doesn't list it. The checkbox above the table adds that rule.

One limit: if the SLO is loose enough, even a total outage can't spend 2% of the budget in an hour, and the fast page never fires. A 90% SLO over 30 days is that case. A 100% outage spends about 1.39% of that budget in an hour. The table says the alert won't fire.

The generated rules record the error ratio with rate() and alert when both windows cross the threshold. They're a starting point, the same way the workbook's windows are. Change them when you know your traffic and your paging load.

What's in the link

Copy link puts the current state in the query string. slo is the target percent, days is the window, rate and per (s, min, h, d) are the request rate, bad is the observed error percent, spent is the percent of budget already used, and elapsed with unit (h or d) says how far into the window you are. fast=1 includes the faster ticket. err, total, and record are the Prometheus names. A field that's omitted is the default: 99.9% over 30 days.