Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Observability & SREMixed 21 series

Writing runbooks people actually follow

A runbook is read at 03:00 by someone who did not write it, cannot reach the author, and wants to stop the bleeding. Most runbooks are written for another reader: the reviewer, the auditor.

Quick reference

A procedure you can run at 03:00, with the commands you really type.

  1. Title the alert — The page is found from the pager, so it opens with the alert words.
  2. One check per step — A command, its expected output, and the branch that follows.
  3. Commands, not prose — Real commands with placeholders, exit codes and an undo.
  4. Test, then own it — A stranger runs it, an owner reviews it, a date retires it.

In one line: A procedure with an owner and a test. Write it for the tired reader, and delete it when it stops being true.

Start this week:

  • Write the page while the next incident is fresh, not at review time.
  • Have someone outside the team run it before you link it from an alert.
  • Re-run the page in the next game day and fix what broke.

Explained

Structure

A runbook is a decision tree: the symptom in the words of the alert, one check per step, then the action, the expected output and the undo. Every branch ends with an escalation and a timer.

Commands

Paste the real command, not a description. Absolute paths, explicit flags, placeholders in brackets, exit codes explained. If a command needs editing before it runs, it will be edited wrongly.

Test

The author cannot test it, because they know the answer. Give the page to a stranger in staging and time them from the alert to the first correct action. Every question they ask is a missing line.

Upkeep

Give the page an owner, a review date and a death condition. Link it from the alert and review it after each incident.

Lesson: write for the tired reader, test on a stranger.

Checklist

Check every page before it ships, and again after the first incident that uses it.

Find it

  • The title matches the alert text.
  • The link sits in the alert and the dashboard.
  • The page opens without a login.

Run it

  • The first check is above the fold.
  • Commands run as written, with no edits.
  • Expected output is shown for each check.

Finish it

  • Every branch ends in an action or an escalation.
  • Rollback or undo is written for each change.
  • Exit codes and their meanings are listed.

Keep it

  • An owner and a review date are on the page.
  • A stranger ran it and their questions were fixed.
  • The page is versioned with the service code.

The field guide

The full guide of the PDF (P989), page by page.

A decision tree, not an essay (structure)

The reader is tired, worried and mid-incident. They are not reading for pleasure. Every paragraph must either tell them where they are or what to do next.

  • Start with the symptom, in the words the alert or the user used.
  • Give one check per step, with the output that means yes or no.
  • Name the action, the expected result and how to undo it.
  • End every branch with an escalation path and a timer.
PartQuestion it answers
TriggerHow do I know I am here?
CheckIs it this cause or another?
ActionWhat do I type, and what do I see?
ExitWho do I call, and when?

Two screens If the runbook is longer than two screens, it is a design document. Split it by symptom, not by system.

A runbook that explains the architecture before the fix will be skipped.

Start from the alert (the entry)

A runbook is found from an alert, so the first line must match the alert text. If the alert says checkout 5xx above 2 per cent, the page says the same words.

The first screen

ALERT:  checkout 5xx above 2 per cent for 5m
CHECK:  curl -s https://checkout.example/healthz
EXPECT: {"ok": true, "db": "up", "queue": "up"}
IF NOT: section 3, Database, then section 4, Queue
  • Title the page with the alert name, not the component name.
  • Put the first check above the fold; the reader scrolls under stress.
  • State what a healthy output looks like, character for character.
  • Link the dashboard and the log query beside the check.

Copy, paste, compare Every command must run as written from a shell, with placeholders in angle brackets and a note on where to get the value.

The runbook starts where the pager starts, not where the architecture diagram starts.

Write the commands you type (the commands)

Pseudo-commands cost time at 03:00. Copy the real command from the shell history, strip the secrets, and paste it into the page.

A check with an explicit exit

code=$(curl -s -o /dev/null -w '%{http_code}' \
  https://checkout.example/healthz)
[ "$code" = "200" ] || { echo "FAIL healthz $code" >&2; exit 1; }
  • Use absolute paths and explicit flags; aliases do not exist in a runbook.
  • Keep placeholders in angle brackets and say where the value comes from.
  • Show the expected output, not just the command.
  • Give every script an exit code, and say what each code means.

No secrets Never paste a token, a password or a customer identifier into a runbook. Reference the secret store path and the role that reads it.

A command that needs editing before it runs is a command that will be edited wrongly.

Test it on a stranger (the test)

The author cannot test a runbook, because they already know the answer. Give it to someone who has never seen the service and watch where they stop.

  1. Pick a reader from another team and an environment that can break.
  2. Start the clock at the alert and stop it at the first correct action.
  3. Note every question the reader asks; each one is a missing line.
  4. Fix the page the same day and run it again with a second reader.
MeasureTarget (example)
Time to first actionUnder 5 minutes
Wrong turnsZero before step 3
Questions askedFewer than two

Tabletop first If you cannot break a staging environment, read the runbook aloud and ask the reader what they would type next. It finds half the gaps in twenty minutes.

An untested runbook is a guess with formatting.

Keep it alive or delete it (the upkeep)

A runbook that describes last year's architecture is worse than none, because it is trusted. Give every page an owner, a review date and a death condition.

  • Name one owner, and put the review date at the top of the page.
  • Link the page from the alert, so the reader arrives with context.
  • Review after every incident that used it, and fix it the same week.
  • Delete the page when the service or the procedure is gone.
SignalAction
Alert firesOpen the page from the alert
Incident endsPatch the page in the review
Review date passesOwner re-runs or deletes it

Version it with the code Keep the runbook in the service repository and review it in the same pull request as the alert rule it belongs to.

A runbook nobody owns is documentation; a runbook nobody can find is decoration.

The honest caveat: a runbook cannot fix a system that needs a decision at 03:00, and some procedures are better automated. Write the page when the decision still needs a human.

Your turn: Which runbook was last read by someone who did not write it?

More notes: Observability & SRE

Open in the notes app: search, filters, copy This note on GitHub