SLOs, SLIs & Error Budgets
SLOs make reliability measurable and debatable. Master SLI selection, targets and windows, error budget math, burn-rate alerting, and the processes that turn budget exhaustion into engineering decisions instead of heroics.
What is this?
An SLI (service level indicator) is a quantifiable measure of a user-facing behavior, such as availability or latency. An SLO (service level objective) is a target for that SLI over a window, such as '99.9% of requests succeed and complete in under 300ms over 30 days'. The error budget is the allowed failure — everything above the target — and burning it faster than planned is the trigger for stopping risky work. Burn-rate alerting pages based on how fast the budget is consumed, not on arbitrary thresholds.
Why do you need it?
- SLOs force you to define what 'good' means before an incident, instead of arguing about it during one.
- Error budgets turn reliability into a product decision: the team can spend failure budget on innovation, consciously.
- Burn-rate alerting pages on budget consumption speed, catching both sudden outages and slow degradation with less noise.
- Multi-window, multi-burn-rate alerting reliably separates real budget burns from short blips.
- SLOs replace reliability debates with data conversations shared with stakeholders.
Mental model
A personal monthly budget
An error budget
Your SLO target is what you promise to spend, and the error budget is the money you are allowed to waste before you must stop. A burn-rate alert is the notification that you have spent 80% of the month's fun-money in the first week — the alarm is not about the amount, it is about how fast it is disappearing.
How it works
- Define an SLI with an explicit good/bad definition, for example a good request is one with a status below 500 and a duration under 300ms.
- Pick an SLO window and target, such as 99.9% availability over a rolling 30 days.
- Compute the error budget: one minus the target, converted to real time, e.g. 0.1% of 43,200 minutes is 43.2 minutes per 30 days.
- Track budget consumption continuously: each bad event burns budget at a rate, and the burn rate is the observed error rate divided by the allowed error rate.
- Alert on burn rate with multi-window rules — a fast-burn window (14.4x for 5 minutes) and a slow-burn window (3x for 1 hour) — so both acute and chronic failures page.
From user behavior to an SLO-driven page.
Key commands
curl -s 'http://localhost:9090/api/v1/query?query=error_rate_30m'Read a recording rule that computes the SLI error rate over 30 minutes.
curl -s 'http://localhost:9090/api/v1/query?query=burn_rate'Query the current burn rate against the SLO target.
curl -s http://localhost:9090/api/v1/rulesInspect the recording and alerting rules backing the SLO.
promtool check rules slo.rules.ymlValidate the SLO rule file before reloading.
curl -s http://localhost:9090/api/v1/targets | grep stateConfirm the SLI source targets are being scraped.
Examples
SLI, error budget and burn-rate math in PromQL
# Allowed error rate implied by the SLO1 - 0.999 # = 0.001 → 43.2 minutes of the 43,200 in 30 days # Good requests: status < 500 AND latency under 300mssum(rate(http_requests_total{status!~"5..", duration<=0.3}[30m])) # Observed error rate over the last 30 minutessum(rate(http_errors_total[30m])) / sum(rate(http_requests_total[30m])) # Burn rate: how fast the error budget is being consumedsum(rate(http_errors_total[30m])) / sum(rate(http_requests_total[30m])) / (1 - 0.999) # Fast-burn page: consuming at >14.4x for 5 minutesrate(http_errors_total[5m]) / rate(http_requests_total[5m]) / (1 - 0.999) > 14.4The budget comes from the SLO target: 0.1% of a 30-day window. Burn rate is the observed error rate divided by the allowed error rate, so 14.4x means the budget that should last 30 days would be gone in about one hour. Alerting on burn rate, rather than the raw error rate, produces the same page whether traffic is high or low.
In production
- The checkout service carries an availability SLO of 99.9% and a latency SLO of p99 under 300ms, both measured at the API gateway.
- When burn rate crosses the page threshold, the deployment pipeline freezes until the budget recovers — reliability gates shipping.
- A monthly SLO review is where reliability decisions get made: what to fix, what to invest in, and what target to renegotiate.
- Three burn-rate alerts replaced forty threshold alerts, cutting nightly noise while catching degradation earlier.
- Per-region SLOs surface regional regressions that a global average would hide.
Best practices
- Pick SLIs that reflect user-visible good and bad, measured from the front door of the service.
- Use rolling windows — a 28 to 30 day window plus a recent short window — to catch both chronic and acute problems.
- Set realistic targets; a 100% target guarantees constant paging and freezes all innovation.
- Page on burn rate, not raw error rate; that is what makes the budget useful for alerting.
- Track the error budget on a dashboard the team reads daily, not a spreadsheet updated after incidents.
Common mistakes
- Choosing SLIs that nobody can verify against real user impact.
- Setting 99.999% targets when the team has no capacity or process to defend them.
- Alerting on raw error rate so the pager fires on blips that barely touch the budget.
- Computing SLOs only in post-hoc spreadsheets instead of continuously from metrics.
- Treating budget exhaustion as a fire drill instead of an enforced process gate on risky changes.
Common issues
A burn-rate alert fires but users seem fineThe SLI definition counts events users do not see, or the denominator dropped, inflating the rate.
Review the good/bad definition against real user traffic and confirm request volume in the denominator.
The error budget is exhausted instantly during a flappy deployA fast burn on a poor rollout while no multi-window confirmation was in place.
Use canary rollouts, verify the burn with the slow-burn window, and gate deploys on budget health.
The SLO dashboard shows below-target for old, irrelevant dataThe window is misaligned so old incidents still count against the rolling window.
Use aligned rolling windows evaluated from the current instant and consider a shorter recency window.
Debugging tips
- When a burn alert fires, compute which window consumed the most budget to tell acute from chronic.
- Verify the SLI denominator — a drop in request volume can fake a high error rate.
- Replay SLO rules with promtool test rules against historical data to tune windows.
- Keep separate recording rules for good and bad totals so you can inspect the inputs of the burn rate.
- Compare the 1-hour window against the 30-day window to see whether a burn is new or long-running.
Interview checkpoint
Hands-on lab
- Feed an SLI through node-exporter's textfile collector
- Define recording rules for error rate and burn rate
- Evaluate the burn rate against the 99.9% target
- Reason about the resulting error budget in minutes
Compute an Error Budget and a Burn Rate
30 min · advanced
Quick quiz
A service with a 99.9% SLO over 30 days has an error budget of approximately:
A burn rate of 1 means:
Alerting on error-budget burn rate reduces alert fatigue compared with raw error thresholds.
Cheat sheet
30d window = 43,200 minBase for availability mathbudget = (1 - target) × window99.9% → 43.2 minburn rate = error rate / (1 - target)Speed of budget consumption14.4x for 5mFast burn: 5% of budget per hour3x for 1hSlow burn: sustained degradationgood_requests_totalRecording rule for SLI numeratorbad_requests_totalRecording rule for failureserror_rate_30mObserved error rate over the windowburn_rateObserved ÷ allowed error ratepromtool test rulesReplay rules against history