Azure 62: SLOs, SLIs & Error Budgets
easy⏱ 5 mincourseazure
SLI → SLO → error budget
An SLI (Service Level Indicator) is a measured ratio — e.g. successful / total requests. An SLO (Objective) is the target — e.g. 99.9% over 28 days. The error budget is 1 − SLO: at 99.9% you're allowed 0.1% failures. Spend it on risky deploys; when it's exhausted, freeze features and fix reliability.
// 99.9% over 1,000,000 requests
// budget = 0.1% x 1,000,000 = 1000 allowed errors
Burn rate
Burn rate is how fast you're spending the budget. Burn rate 1 means you'll exactly exhaust it by the window's end; 10x means a month's budget gone in ~3 days — page someone. Multi-window burn-rate alerts (fast + slow) catch both spikes and slow leaks.
Compute the error budget
Write errorBudget(total, failed, sloPercent) returning { allowed, used, remainingPct } where allowed = total × (1 − sloPercent/100). For total=1,000,000, failed=600, slo=99.9 → allowed 1000, remaining 40%. Log allowed errors: N and budget remaining: N%.
Pick user-centric SLIs
Measure what the user feels — success rate and latency at the edge, not CPU. A green dashboard of host metrics while users get 500s is the most common reliability lie.
Quiz: what happens when the budget is exhausted?
When the error budget is spent, the team freezes risky changes and prioritizes reliability until it recovers — that's the whole point of making reliability a budget.