The idea in one minute#
A runbook is a short, specific document attached to an alert: what the alert means, how bad it is, how to confirm it, and the safe steps to mitigate it. A playbook is broader: how to handle a class of situation (a region failure, a data breach, a database failover) across many alerts. Both exist so that whoever is on call — possibly someone who has never touched this service — can act correctly at 3 a.m. without improvising.
Google measured that on-call engineers with a playbook were roughly three times faster to mitigate than those without one. A runbook that is out of date, however, is worse than none, because people trust it. So runbooks live next to the code, are linked from every alert, are tested in game days, and are updated after every incident that used them.
An analogy#
An airline pilot’s quick reference handbook: for “engine fire”, a one-page checklist in a fixed order, written calmly in advance by people who are not under stress. Pilots still use judgement — but they do not improvise the first steps.
A picture#
flowchart LR AL[":pagerduty: <b>Alert</b><br/><small>runbook_url annotation</small>"] --> RB[":i-book-open: <b>Runbook</b>"] RB --> M["Meaning<br/><small>what users feel</small>"] RB --> C["Confirm<br/><small>dashboard, queries</small>"] RB --> MI["Mitigate<br/><small>safe steps, in order</small>"] RB --> ESC["Escalate<br/><small>who, when</small>"] MI --> AUTO[":i-terminal: Scripts / buttons<br/><small>rollback, drain, flag off</small>"] INC["After the incident"] -->|"update what was wrong"| RB class AL warn class RB memory class M,C,ESC neutral class MI compute class AUTO io class INC queue
How it really works#
The runbook template#
# CheckoutErrorBudgetBurnFast
**Severity:** page · **Service:** checkout-api · **Owner:** payments team
**Dashboard:** https://grafana.example.com/d/checkout-slo
**Last verified:** 2026-09-28 in game day GD-14
## What it means
Checkout requests are failing (5xx or 429) fast enough to spend at least 2% of the 28-day
error budget per hour. Shoppers cannot pay. Every minute costs roughly $700 in lost orders.
## Confirm (2 minutes)
1. SLO dashboard: is the error ratio above 1.44%? Which region(s)?
2. Is it all routes or one? `sum by (route) (rate(http_requests_total{job="checkout",code=~"5.."}[5m]))`
3. Did something change? #deploys channel, `kubectl -n payments rollout history deploy/checkout`,
feature-flag audit log.
## Mitigate (in this order — stop when the error ratio recovers)
1. **Recent deploy (last 2 h)?** Roll back:
`kubectl -n payments rollout undo deploy/checkout` — safe, takes ~2 min.
2. **Recent flag change?** Turn the flag off in the flag console. Safe.
3. **Errors only from one zone/region?** Drain it: `./ops/drain-zone.sh payments eu-west-1b`.
Safe if the other zones are below 60% CPU.
4. **Payments provider errors (`upstream=payments` in logs)?** Switch provider:
`./ops/payments-failover.sh --to=secondary`. Safe; increases fees ~0.3%.
5. **DB connection pool saturated (`db_pool_waiting` > 0)?** Scale checkout down? NO — this makes
it worse. Page the DB on-call: see Escalate.
## Escalate
- No improvement after 15 minutes, or customer data at risk → declare an incident (5.a),
page incident commander rotation.
- Database: page `db-oncall` in PagerDuty.
- Payments provider: status page https://status.payments.example, support line in the vault entry "payments-vendor".
## Background
Architecture diagram, dependencies, links to the last three postmortems that used this runbook.What makes a runbook good#
| Property | Why |
|---|---|
| Linked from the alert | Nobody should have to search |
| Meaning first, in user terms | Decides how urgently to act |
| Steps in order of safety and likelihood | Most common, safest fix first |
| Each step says whether it is safe and what it costs | So the responder does not have to judge risk under stress |
| Copy-pasteable commands, with the namespace and names filled in | No improvising syntax at 3 a.m. |
| Explicit stop condition | “Stop when the error ratio recovers” |
| Escalation with names and channels | Not “contact the DB team” |
| Last verified date | Tells the reader how much to trust it |
Keeping runbooks true#
- Store them in the service’s repository (Markdown), reviewed like code, and render them in the internal docs site. A wiki page nobody owns rots.
- CI checks that every alert has a
runbook_urland that the link resolves. - After every incident that used a runbook, the postmortem has an action item: “update the runbook with what was wrong or missing”.
- Exercise them in game days and wheel-of-misfortune sessions (Module 10).
Runbooks are a step on the automation ladder#
A runbook step that is always run the same way is a candidate for a script; a script that is always run when an alert fires is a candidate for automation (1.c). Good runbooks shrink over time as their steps become buttons and then disappear into the system. Tools like Rundeck, StackStorm, PagerDuty Runbook Automation and plain chat-ops bots turn steps into one click with an audit log.
Playbooks#
Playbooks cover situations, not alerts:
- Region or zone failure — how to evacuate traffic, who decides, which services fail over.
- Database failover — manual promotion steps, how to check for split brain (9.c).
- Security incident — who to call, preserve evidence, do not wipe machines.
- Major third-party outage — cloud provider, CDN, DNS, identity provider.
- Data corruption — stop the writers first, then assess, then restore (9.a).
A worked example#
At 02:14 an engineer three weeks into on-call is paged: CheckoutErrorBudgetBurnFast.
- 02:15 — Opens the runbook from the page. Confirms on the dashboard: 6% errors, all regions.
- 02:17 — “Did something change?” A deploy at 01:52 (an automated dependency update).
- 02:18 — Step 1:
kubectl rollout undo. Marked safe, so no need to wake anyone. - 02:21 — Error ratio back under 0.1%. Stop condition met.
- 02:30 — Writes the incident note; the rollback is mentioned in the handoff.
Without the runbook the engineer would have hesitated to roll back a change they did not make. The postmortem adds one line to the runbook: “automated dependency updates deploy at 01:50 — check them first at night”.
The program below is the CI check from above: it verifies that every alert rule has a runbook, and that every runbook has the required sections and has been verified recently.
Code#
// runbookcheck.go — CI check: every alert has a runbook with the required sections, recently verified.
package main
import (
"fmt"
"os"
"regexp"
"sort"
"strings"
"time"
)
// In CI these come from the rule files and the runbooks/ directory; here they are inline.
var alerts = map[string]string{ // alert name → runbook_url annotation
"CheckoutErrorBudgetBurnFast": "runbooks/checkout-error-budget-burn.md",
"CheckoutLatencyBudgetBurn": "runbooks/checkout-latency-burn.md",
"DiskWillFillIn4h": "",
}
var runbooks = map[string]string{
"runbooks/checkout-error-budget-burn.md": `# CheckoutErrorBudgetBurnFast
**Last verified:** 2026-09-28
## What it means
Shoppers cannot pay.
## Confirm
Dashboard.
## Mitigate
1. Roll back.
## Escalate
db-oncall`,
"runbooks/checkout-latency-burn.md": `# CheckoutLatencyBudgetBurn
**Last verified:** 2025-11-02
## What it means
Checkout is slow.
## Mitigate
Scale up.`,
}
var required = []string{"## What it means", "## Confirm", "## Mitigate", "## Escalate"}
var verified = regexp.MustCompile(`\*\*Last verified:\*\*\s*(\d{4}-\d{2}-\d{2})`)
func main() {
now := time.Date(2026, 10, 24, 0, 0, 0, 0, time.UTC)
const maxAge = 180 * 24 * time.Hour
problems := 0
report := func(format string, a ...any) {
problems++
fmt.Printf(" ✗ "+format+"\n", a...)
}
names := make([]string, 0, len(alerts))
for a := range alerts {
names = append(names, a)
}
sort.Strings(names)
for _, alert := range names {
url := alerts[alert]
fmt.Println(alert)
if url == "" {
report("no runbook_url annotation")
continue
}
body, ok := runbooks[url]
if !ok {
report("runbook %s does not exist", url)
continue
}
for _, sec := range required {
if !strings.Contains(body, sec) {
report("missing section %q", strings.TrimPrefix(sec, "## "))
}
}
m := verified.FindStringSubmatch(body)
if m == nil {
report("no 'Last verified' date")
continue
}
d, _ := time.Parse("2006-01-02", m[1])
if age := now.Sub(d); age > maxAge {
report("last verified %s, %d days ago (limit %d)", m[1], int(age.Hours()/24), int(maxAge.Hours()/24))
}
}
if problems > 0 {
fmt.Printf("\n%d problem(s); a CI run would fail here\n", problems)
if os.Getenv("CI") != "" {
os.Exit(1)
}
return
}
fmt.Println("all runbooks OK")
}Two of the three alerts fail. Run it with CI=1 go run runbookcheck.go and it exits with status 1, as a CI check should.
Remember this#
- Runbooks are per alert; playbooks are per situation.
- Meaning, confirm, mitigate (safest and likeliest first, each step marked safe or not), escalate.
- Copy-pasteable commands, a stop condition, a last-verified date.
- Keep them in the repo, check them in CI, update them after every incident, exercise them in game days.
Try it#
- Run
runbookcheck.go. Fix the data so it passes. - Write the runbook for one alert you own, using the template. Time how long it takes a colleague to follow it on a test environment.
- List three playbooks your organisation needs and does not have.
Check yourself#
- What is the difference between a runbook and a playbook?
- Why should each mitigation step say whether it is safe?
- Why is an out-of-date runbook worse than none?
- How does a runbook relate to the automation ladder?