SLOs, Error Budgets & Actionable Runbooks
Define Service Level Indicators (SLIs), SLOs, and multi-window burn-rate alerts, and write runbooks that let on-call engineers mitigate incidents in minutes.
TL;DR
Every production service needs two artifacts before go-live: an SLO (availability + latency SLIs with an error budget) and a runbook linked directly from every alert. Page on SLO burn rate, mitigate first (rollback or fail over) before root-causing, and run a blameless postmortem within 5 business days.
Why it exists
Alerts like "CPU > 80%" or "Pod restarted once" train engineers to ignore pages. Meanwhile, an alert without a runbook leaves the 02:00 AM on-call engineer guessing which command checks database locks or how to roll back safely.
Mental model
1. SLI → SLO → Error Budget
- Availability SLI:
good_requests / total_valid_requests(excluding client 4xx errors where appropriate). - Latency SLI:
requests_faster_than_threshold / total_valid_requests(e.g.<= 300msat p99). - 30-day 99.9% SLO = 43.2 minutes of allowed downtime per 30 days. When the budget hits zero, freeze risky feature launches and focus on reliability work.
2. Multi-window burn-rate alerting
- Fast burn (page immediately): Consuming > 2% of the 30-day budget in 1 hour (
14.4xburn rate over1hAND5m) → severe outage. - Slow burn (ticket / next-day): Consuming > 5% of the budget in 6 hours (
6xburn rate) or1x–3xover days → silent degradation.
3. Runbook anatomy (one page, copy-pasteable)
Every runbook linked via annotations.runbook_url should answer five things in under 60 seconds:
- Impact & severity (what users feel, tier/SLA).
- Triage commands (exact
kubectl/ PromQL / KQL queries to confirm the symptom). - Mitigation steps (rollback digest, drain node, scale replicas, toggle feature flag).
- Verification (how to confirm the SLI recovered).
- Escalation (who to page next if mitigation fails).
Do it
Example Prometheus multi-window burn-rate alert linking to a runbook:
# Multi-window fast-burn SLO alert (not run)
groups:
- name: payment-slo
rules:
- alert: PaymentErrorBudgetFastBurn
expr: |
(
job:http_errors:ratio_rate5m{service="payment"} > (14.4 * 0.001)
and
job:http_errors:ratio_rate1h{service="payment"} > (14.4 * 0.001)
)
for: 2m
labels:
severity: page
annotations:
summary: "Payment service burning 99.9% error budget at 14.4x"
runbook_url: "https://runbooks.internal.example/payment/high-error-rate"Gotchas
- 100% SLO targets: Demanding 100% leaves zero error budget for deployments, maintenance, or hardware failures—use 99.9% or 99.95% unless you have multi-region active-active funding.
- IC doing the debugging: In a major incident, if the Incident Commander also runs
kubectlcommands, nobody tracks the timeline, stakeholder updates, or escalation clocks. - Stale runbooks: A runbook that references a retired namespace or old CLI flags fails during an incident; verify runbooks during quarterly game days.
Production checklist
- Every tier-0/tier-1 service has written availability and latency SLIs/SLOs.
- Paging alerts use multi-window burn rates and include a valid
runbook_url. - Incident roles (IC, Ops, Comms, Scribe) and break-glass access rules are documented.
- Blameless postmortems happen within 5 business days with tracked action items.
Check yourself
Check Yourself
1. Why does the Google SRE Workbook recommend checking BOTH a short window (e.g. 5m) and a longer window (e.g. 1h) in a burn-rate alert?
2. What is the primary job of the Incident Commander (IC) during a SEV1 outage?
Sources
Related Notes
DevSecOps Pipeline: Automated Gates from Commit to Admission
How automated security gates—pre-commit secret scanning, SAST, SCA, IaC checks, Trivy, Cosign signing, and Kyverno admission—protect production without manual bottlenecks.
OOP Pillars in TypeScript
Encapsulation, abstraction, inheritance, and polymorphism explained with practical TypeScript examples and modern composition trade-offs.