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.
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 fractionA 99.9% target over 30 days:
30 × 24 × 60 = 43,200 minutes
43,200 × 0.001 = 43.2 minutes43.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 rateA 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) × windowSpending 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 fractionThe 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.