Runbooks and on-call rotations people can follow at 3 a.m.
Write runbooks that a tired responder can follow at 3 a.m., keep pages actionable, and run on-call rotations with clear escalation and a sustainable load.
Contentsand lesson path
On this page
- The problem: a runbook for someone who has just woken up
- Worked example: the checkout latency runbook, step by step
- Sustainable on-call rotations and alert hygiene
- Check your understanding
- Apply it
- Review prompt
Lessons of Incident Response Basics
- What counts as an incident, and who does what Concept · 15 min
- Mitigate first: stopping the damage before explaining it Concept · 15 min
- Runbooks and on-call rotations people can follow at 3 a.m. Worked example · 20 min
- Game day: a simulated outage with assigned roles Lab · 30 min
- Writing the postmortem: from timeline to action items Worked example · 20 min
- Check: incident scenario review Knowledge check · 8 questions
What you will learn
- Triage from dashboards and runbooks and apply a mitigation (rollback, failover, scaling or feature flag) before investigating root cause.
- Prepare for on-call with actionable runbooks, an escalation path and an alert review that removes noisy pages.
Prerequisites: Observability
01. The problem: a runbook for someone who has just woken up
Suppose an alert pages you at 3:15 a.m. For the first minutes after waking you have sleep inertia: slower reactions, weaker short-term memory and poorer judgement than in the daytime. In that state, a 15-page architecture wiki, vague prose or a shell pipeline you have to invent yourself are all places where mistakes happen.
A production runbook (also called a playbook) is not full system documentation. It is a checklist for one alert, written so that a tired person who may not know the service can follow it. Every paging alert should link to its runbook, and each runbook needs five parts:
- Trigger and user impact: the exact alert name, its firing condition, and what customers are experiencing (for example "Checkout HTTP 500 error rate > 5%; customers unable to complete orders").
- Quick triage: one copy-pasteable command or dashboard link that confirms whether the alert is a real production failure or a monitoring blip.
- Step-by-step mitigation: exact commands or console steps to restore service (for example a rollback, a scaling command or a feature flag), each with the output that shows it worked.
- Recovery check: the metric and value that prove service is back to normal (for example "error rate < 0.1% for 5 continuous minutes").
- Escalation path: who to page next if the mitigations have not worked within 15 minutes, with names or rotation names, chat handles and phone escalation.
The task for this lesson: write that runbook for a checkout API on Kubernetes (namespace prod) whose p99 latency, the time within which 99% of requests finish, has gone above 2 seconds. The sections below build it in four parts.
02. Worked example: the checkout latency runbook, step by step
Step 1: name the alert and the user impact. Start with the exact alert name and its condition, so that the responder can match the runbook to the page they received. Then say what customers see. The impact line tells the responder how urgent this is before they open a dashboard.
# Alert: CheckoutAPILatencyHigh (p99 > 2.0s for 5m)
## 1. User Impact
* Customers experience spinning checkout buttons or HTTP 504 timeouts.
* Estimated order completion drop: ~25% during active alert.Step 2: triage with commands and the output to expect. The first two questions after most pages are "did something change?" and "is something saturated?". Give one command for each, and show what an abnormal answer looks like, so that the responder does not have to interpret raw output alone. The sample output below is illustrative: names and ages come from an imagined cluster.
## 2. Immediate Triage (run within 3 minutes)
```bash
# Was there a rollout in the last 60 minutes? Newest ReplicaSet is last;
# its AGE column is the time since that rollout started
kubectl get rs -n prod -l app=checkout-api \
--sort-by=.metadata.creationTimestamp
```
Recent rollout looks like this (newest line, AGE under 60m):
```text
NAME DESIRED CURRENT READY AGE
checkout-api-7d9f8b6c4d 0 0 0 6d
checkout-api-5b8c9d7f6e 10 10 10 12m
```
```bash
# CPU and memory per container (the CPU limit is 1 core = 1000m)
kubectl top pods -l app=checkout-api -n prod --containers
```
Saturation looks like CPU near 1000m on most pods:
```text
POD NAME CPU(cores) MEMORY(bytes)
checkout-api-5b8c9d7f6e-2xq8p checkout-api 962m 412Mi
```Step 3: one branch per likely cause. Write the mitigation as if/then branches, each with the exact command and the output that confirms it ran. The rollback branch applies only when the release is marked rollback-safe, for the reason lesson 2 explains: rolling back past a migration can break the old version. A second branch covers the release that is not rollback-safe.
## 3. Mitigation Steps
* **Branch A (deployed recently, release marked rollback-safe):** roll back:
`kubectl rollout undo deployment/checkout-api -n prod`
Expected: `deployment.apps/checkout-api rolled back`
* **Branch A2 (deployed recently, NOT rollback-safe):** turn off the
release's feature flag named in its release notes; page the release owner.
* **Branch B (traffic surge, CPU > 90%):** scale out replicas:
`kubectl scale deployment/checkout-api -n prod --replicas=20`
Expected: `deployment.apps/checkout-api scaled`
* **Branch C (downstream payment gateway timing out):**
enable the offline payment queue fallback via feature flag:
`curl -fsS -X POST https://flags.internal/toggle -d "flag=offline_pay&val=on"`
Expected: exit code 0 (`-f` makes curl fail on an HTTP error status)Step 4: define "recovered" and when to escalate. Recovery needs a number and a duration, so that the responder knows when to stop. Escalation needs a time limit and a named target, so that nobody struggles alone for an hour out of politeness.
## 4. Recovery Verification
* Check Datadog/Prometheus: `checkout_latency_p99 < 0.5s` for 3m.
* HTTP 5xx error rate drops below 0.05%.
## 5. Escalation (if unresolved within 15 minutes)
* Page Secondary On-Call: `#oncall-sre` or PagerDuty escalation tier 2.
* Page Database Admin on-call if PostgreSQL connections exceed 950.03. Sustainable on-call rotations and alert hygiene
An on-call rotation only works if the people on it can sleep most nights and trust the pages they get. Six habits help:
- Page on symptoms, not causes. Google's SRE guidance is to page people on symptoms that users feel, not on underlying causes. "User-facing checkout error rate > 2%" is a symptom: customers cannot complete purchases. "Redis memory usage at 78%" is a cause: the cache might level off at 80% without ever affecting a transaction. Causes belong in tickets, dashboards or autoscaling policies. The SRE book allows one exception: a cause that is very definite and very imminent, such as a disk that will be full within the hour, may page too.
- Every page should need action. If an alert fires at 3 a.m., and the engineer acknowledges it, finds users unaffected and goes back to sleep without doing anything, that alert is noise. Noise teaches people to ignore pages, real ones included. Review the pages regularly (for example weekly), and delete the ones nobody acted on or turn them into daytime tickets or dashboards.
- Keep runbooks current. Runbooks go stale quickly if they live on a wiki nobody checks. Store them in Git next to the deployment manifests, review them whenever the manifests change, and use them in onboarding drills, so that broken commands and URLs are found before an incident.
- Escalate without guilt. On-call engineers often hesitate to wake a teammate or a specialist, out of politeness or fear of looking incompetent. Escalation paths exist so that hard outages get help early. Agree a time limit in advance: for example, if 15 to 20 minutes of work has not reduced the impact, page the secondary on-call.
- Shifts and rest. Teams spread across time zones can use follow-the-sun rotations: for example Europe hands over to the Americas, which hands over to Asia-Pacific at local 09:00 and 17:00, so that most pages reach someone during their working day. The Google SRE book describes week-long shifts and pays on-call work with time off or cash. Whatever shift length you choose, give people rest after a disruptive night.
- A load limit. The Google SRE book estimates that each incident, with its analysis, fix and postmortem, takes about 6 hours, so it sets a maximum of 2 incidents per 12-hour shift. When a service stays above that, the SRE team can ask the developer team to take the pager for that service until it meets the standard again.
04. Check your understanding
05. Apply it
Write and test a runbook for one alert. This takes about 30 minutes on any Linux machine.
- Pick an alert from a system you run (at work, a home server or a side project). If you have none, use this one: "disk usage on
/above 90%" on your own Linux machine. - Write
runbooks/<alert-name>.mdwith the five parts from this lesson. For the disk alert, triage could usedf -h /andsudo du -xh --max-depth=1 / | sort -h | tail -n 5; mitigation could clean old logs withsudo journalctl --vacuum-size=500M; escalation names the person you would ask for help. - Run every command in the runbook and paste the real output under it as the expected output. Where a command needs a condition you do not have (a full disk), write what the abnormal output would show.
- The next day, follow the runbook from the top with a timer, without reading anything else. Mark each place where you stopped to think, and rewrite that step.
Produce: the runbook file and a list of the steps you rewrote. A runbook that you can follow in under five minutes without stopping is ready for someone else to try.
06. Review prompt
Without looking back: name the five parts of a runbook and say how each one helps a responder who has just woken up. What is the difference between paging on a symptom and paging on a cause? When should an on-call engineer escalate, and what does the Google SRE book suggest when the load stays above about two incidents per shift?
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.