Advanced
Searching inHow-to guides
How to search
  • Type the task in your own words (find port, open firewall, disk full) or paste an error message in quotes.
  • Choose "Quick answer" to see only the commands, or an area to stay in one field.
  • "two words" finds the exact phrase.
  • Plain words find names, texts and examples.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search
Try:

How-to 183Operations · On-call

How to write a runbook for on-call

At 3 a.m. the alert says ApiErrorBudgetFastBurn and the person on call has never touched the API. A runbook tells them, in a few minutes, what the alert means, how bad it is, what to check, how to fix the usual causes, and whom to call. Good runbooks are short, tested, live in Git next to the alerts, and every alert links to one. This how-to gives a template and the rules that keep runbooks useful.

  • 5 Lessons
  • 3 Commands

$ run as a normal user# run as root (or with sudo)

183.1

The quick answer

runbooks/api-errors.md
# API error rate high (ApiErrorBudgetFastBurn)
 
Service: checkout-api · Owner: team-payments · Dashboard: https://grafana.example.com/d/api
Severity: page — customers cannot pay.
 
## 1. Check (2 minutes)
- Dashboard: which route and which status codes? Since when?
- Last deploy: `kubectl -n shop rollout history deploy/checkout-api`
- Dependencies: database and payment provider status page.
 
## 2. Fix the usual causes
- Started right after a deploy → roll back: `kubectl -n shop rollout undo deploy/checkout-api`
- Database connections full → see "Database connections" runbook.
- Payment provider down → switch the feature flag `payments.fallback` on.
 
## 3. Escalate
- Not better in 15 minutes → call the team-payments lead (on-call tool), open an incident channel.
 
## 4. After
- Write a short incident note: time line, cause, follow-up tasks.

183.2

Step by step

  1. One runbook per alert — the alert has runbook_url in its annotations, so the link is in the page itself.
  2. Start with meaning and impact — one line: what is broken for users, and how urgent it is.
  3. Check before fixing — the 3–5 things to look at first, with exact links and commands that can be copied. No "investigate the issue".
  4. Fix steps for known causes — the top causes from past incidents, each with the safe action (rollback, restart, scale, feature flag) and how to see that it worked.
  5. Escalation — who, when (time limit), and how (tool, phone), plus the incident channel.
  6. Keep it short — one screen if possible. Background and architecture go in a linked document.
  7. Store in Git next to the alert rules, reviewed in pull requests. Owner and "last tested" date on top.
  8. Test it — in a game day a new team member follows the runbook against a staging failure; fix every step that was unclear. Update the runbook after each real incident.
  9. Automate the boring steps — when a step is always the same, make it a script or a button, and link it.

183.3

Check that it worked

Every alert rule has a runbook_url that opens (a script can check all of them); a team member who does not know the service fixes a staging failure with the runbook alone in the planned time.

183.4

Common problems

ProblemCauseFix
Runbook is out of dateWritten once, never updated.Owner + "last tested" date; update after each incident.
Steps say "check the logs"Too vague for a tired person.Exact link, command and what "bad" looks like.
Alert has no runbookCreated without the annotation.Make runbook_url required in rule review (lint in CI).
Fix step is dangerousRestart of a database without checks.Add "before you do this" checks and a rollback.
Runbook in a wiki nobody can reach during an outageThe wiki runs on the broken platform.Copy in Git and a static site outside the platform.
Too long to read at 3 a.m.History and design mixed in.Move background to a linked page.

183.5

Go further

1Where should the link to a runbook be?

In the alert itself (the runbook_url annotation), so the person on call opens it straight from the page.

2How do you know a runbook is good?

Someone who does not know the service follows it in a drill and fixes the problem without help.

All commands in this chapter