Incident response and postmortems
Roles, severity, a live timeline and a blameless review: the parts of an incident that are not debugging, practised on a game day where you do not know the fault
A postmortem concludes: 'Root cause: an engineer ran the deletion script against the wrong list of ids.' The single action item is 'retrain the engineer and remind the team to double-check ids'. What is the most likely result over the next year?
Most of this course is about making a system explain itself. This chapter is about the people reading the explanation at 3 am while customers cannot pay. In a real incident the telemetry is rarely the bottleneck. The bottleneck is that three engineers are each debugging a different theory, nobody has told support what to say, someone restarts the database while someone else is reading its logs, and an hour later nobody can say when it started.
Incident response is a small set of practices that fix that: decide early that it is an incident, give it a severity, split the work into roles, keep one live document, mitigate before you diagnose, and afterwards write a review that changes the system rather than the people. You will practise all of it on a game day where someone else picks the fault.
What counts as an incident
An incident is an unplanned event that needs a coordinated response. The Google SRE book’s chapter on managing incidents gives three tests: does fixing it need a second team, is it visible to customers, and is it still unsolved after an hour of concentrated analysis? If any is true, declare.
Declare early. Declaring costs a channel, a document and a few minutes of someone’s attention. Not declaring costs the first hour of a big incident, during which nobody is coordinating because nobody agreed there was anything to coordinate. A small incident that turns out to be nothing is closed in five minutes with no harm. Teams that punish false alarms, even with a raised eyebrow, train people to wait, and waiting is how a SEV-3 becomes a SEV-1.
Severity
Severity is a promise about the size of the response, not a judgement on anyone. It decides who is paged, how often stakeholders hear from you, and whether a postmortem is required. A scale only works if it is defined in terms of customer impact that someone half-awake can check in a minute. For the demo app:
| Severity | Customer impact (checkout) | Response | Updates | Postmortem |
|---|---|---|---|---|
| SEV-1 | more than 50% of checkouts failing, or any data loss or exposure of personal data | page incident commander and service owners; all hands | every 15 min, internal and public | required, within 5 working days |
| SEV-2 | more than 5% of checkouts failing, or p99 above 2 s, for 10 min | page incident commander and service owner | every 30 min internal | required |
| SEV-3 | degraded but inside the SLO’s error budget, or lost redundancy | page service owner, business hours if stable | at start and end | optional, team decides |
| SEV-4 | no customer impact | ticket | none | no |
The numbers are illustrative; set yours from your SLOs. Two rules matter more than the thresholds. PagerDuty’s response guide states the first plainly: if you are unsure between two levels, pick the higher one, and argue about it in the postmortem, not on the call. The second: severity can change during the incident in either direction, and the commander announces each change.
Roles
The failure pattern in an unmanaged incident is the same everywhere. The SRE book tells it as the story of Mary, an on-call engineer who stays heads-down on the technical problem while the incident grows. Nobody updates leadership, other engineers do not know what to work on, and one of them makes an untested change on his own initiative that crashes more servers. The fix is to separate the jobs.
Incident commander (IC). Owns the incident: holds the overall picture, assigns work, decides, and keeps every role that has not been handed out. The IC does not debug. PagerDuty’s training is blunt about it: the IC should not be “performing any actions or remediations, checking graphs, or investigating logs”. The moment the IC starts reading logs, nobody is coordinating. The IC needs authority more than technical depth.
Operations lead. The only person, or the only small group under one lead, who changes the system. Every change is announced before it happens and recorded after. This one rule prevents the most common way incidents get worse: two people mitigating the same thing in incompatible ways.
Communications lead. Writes the updates to stakeholders, support and, at SEV-1, customers, on the cadence the severity sets. An update is sent on time even when nothing has changed, because “no change, next update at 14:30” stops the side channels where executives ask engineers directly.
Scribe, or planning, in the SRE book’s terms. Keeps the timeline in the live incident document: what was observed, what was decided, what was changed, each with a time in UTC. Tracks follow-ups so they are not lost.
On a small team one person holds several roles. The one combination to avoid is IC with ops, because debugging absorbs all attention. Two techniques from PagerDuty’s training make an IC effective. To make a decision quickly, state the plan and ask “Are there any strong objections?” rather than “Does everyone agree?”. The first gets an answer in five seconds; the second gets silence or a debate. And hand over command explicitly: “You are now the incident commander, I am handing over, do you accept?” with an acknowledgement on the call. Everyone should always know who is in charge.
The first fifteen minutes
A workable order for a responder who has been paged a minute ago:
- Acknowledge the page so it stops escalating, and look at one graph: is the impact real and current?
- Declare in the incident channel with a severity and a one-line description. You are the IC until you hand over.
- Open the incident document from a template. Top of the document: current status, severity, IC, ops lead, comms lead, next update time.
- Get help: page or invite the ops and comms people the severity calls for.
- Stabilise before you diagnose. What changed recently? A deploy, a config change, a traffic spike, a dependency’s status page. If a recent change is plausible, roll it back. If one dependency is failing, fail over or degrade around it. Mitigation is anything that stops the customer impact, and it does not need to be the fix.
- Capture evidence cheaply before mitigation destroys it, if it takes a minute: a trace id of a failing request, a profile, a heap dump,
docker compose logsto a file. Not if it takes thirty. - Set the update cadence and keep it.
Mitigation first is the hardest habit to learn, because engineers want to understand. Understanding can happen tomorrow. Every minute you spend finding the root cause while customers are failing is a minute of impact you chose.
Timelines from telemetry, not memory
After the incident, people remember the story they told themselves. The scribe’s notes are better, and telemetry is better still, because it does not have hindsight. A good postmortem timeline has these timestamps, all in UTC:
- Start of impact: from metrics, the first interval in which the error ratio or latency crossed the line. Not when someone noticed.
- Detection: when an alert fired or a human noticed.
- Response: when someone acknowledged and declared.
- Mitigation: when customer impact stopped, again from metrics.
- Resolution: when the system was back to normal and the incident closed.
The gaps between them are the metrics that matter: time to detect, time to mitigate. Be careful aggregating them. Štěpán Davidovič’s report Incident Metrics in SRE uses simulation to show that mean time to recovery, computed over the handful of incidents a team has per quarter, swings so much with one long incident that it is unfit for trend analysis. Look at each incident’s timeline and at the distribution, not at the mean.
Blameless postmortems
A postmortem is a written review of an incident whose purpose is to change the system so the incident, or its class, is less likely or less harmful next time. “Blameless” is the part teams get wrong.
John Allspaw’s 2012 post at Etsy, Blameless PostMortems and a Just Culture, makes the case. Engineers who expect to be blamed give a defensive account of what happened. Engineers who expect to be learnt from give a detailed one, including the parts that make them look bad. Detailed accounts are what let you find the real conditions. Blameless does not mean nobody is accountable. It means accountability is forward-looking: the people involved help fix the conditions, and they are the best placed to do it.
In practice:
- Ask how, not why. “Why did you run the script?” invites a defence. “What did the screen show you when you ran it? What told you it was the right list?” invites a description.
- Look for the second story. The first story is “the engineer used the wrong ids”. The second is “the tool accepts two kinds of id with the same format, the review checklist does not mention ids, and the script deletes immediately with no soft delete”. The second story is the one with action items.
- Strike counterfactuals. “Should have”, “failed to” and “could have” describe what someone did not do, measured against knowledge they did not have yet. Replace each with what they did and why it made sense at the time.
- Treat “human error” as where the investigation started. Richard Cook’s How Complex Systems Fail puts it in one line: post-accident attribution to a root cause is fundamentally wrong. Incidents in complex systems have several contributing factors, each insufficient on its own.
- Make action items small, owned and typed. Each one has an owner, a priority, a ticket and a type: prevent, detect sooner, or mitigate faster. “Improve monitoring” is not an action item. “Add a burn-rate alert on checkout availability, owner Sam, due 14 November” is.
- Record what went well and where you got lucky. Luck is a finding: it is the safeguard you do not have.
The Etsy Debriefing Facilitation Guide is the practical companion: how to run the meeting, how to keep it from turning into a trial, and the questions a facilitator asks.
Game days
A game day is a planned incident. Someone injects a real fault into a real (or realistic) system and the team responds as if it were live. Its purpose is not to test the system. It is to test the response: do alerts fire, do runbooks work, do people know their roles, does the dashboard answer the question, does anyone know how to roll back payments?
The design rules:
- The responders must not know the fault. Otherwise they practise remembering, not responding. A facilitator, or a script, picks it.
- Set the rules of evidence. Responders use what they would have in production: dashboards, Prometheus, Loki, Tempo, the app’s endpoints. They do not read the fault-injection script or the containers’ environment.
- Define abort criteria before you start. In production game days, the facilitator ends the exercise if real customers are hurt beyond a stated limit.
- Run the full process: declaration, roles, updates on cadence, postmortem. The postmortem of a game day often finds more than the postmortem of a real incident, because nobody is defensive about a fault they did not cause.
The facilitator does step 1 alone. Responders join at step 2 and must not look at gameday.sh or the .gameday/ directory, .env, or docker inspect output until step 6. Working alone, write the script without looking too hard at which number maps to which fault; the random choice and the random delay still give you a surprise.
1. Facilitator: write the fault picker. Save as labs/observability/gameday.sh and chmod +x gameday.sh:
#!/usr/bin/env bash
# Game-day fault picker for the ATLAS demo app. The facilitator runs it.
# Responders must not read this file or .gameday/ until the reveal.
# ./gameday.sh start pick one fault at random and inject it 1-5 minutes from now
# ./gameday.sh reveal print the fault and when it was injected
# ./gameday.sh stop undo every fault and return to the .env defaults
set -euo pipefail
cd "$(dirname "$0")"
DC="docker compose --profile telemetry"
FAULTS=(slow-payments payment-errors bad-deploy redis-down db-frozen payments-crash)
inject() {
case "$1" in
slow-payments) FAULT_SLOW_PAYMENTS_PCT=30 $DC up -d payments ;;
payment-errors) FAULT_ERROR_RATE=0.08 $DC up -d payments ;;
bad-deploy) SERVICE_VERSION=1.1.0 FAULT_ERROR_RATE=0.03 $DC up -d payments ;;
redis-down) $DC stop redis ;;
db-frozen) $DC pause db ;;
payments-crash) $DC stop payments ;;
esac
}
case "${1:-}" in
start)
mkdir -p .gameday
fault=${FAULTS[$((RANDOM % ${#FAULTS[@]}))]}
delay=$((60 + RANDOM % 241))
printf '%s\n' "$fault" | base64 > .gameday/sealed
nohup "$PWD/$(basename "$0")" _inject "$fault" "$delay" > .gameday/inject.log 2>&1 &
echo "armed: one fault will be injected within 5 minutes. Hand over to the responders."
;;
_inject)
sleep "$3"
date -u +%Y-%m-%dT%H:%M:%SZ > .gameday/injected_at
inject "$2"
;;
reveal)
echo "fault: $(base64 -d < .gameday/sealed)"
echo "injected at: $(cat .gameday/injected_at 2>/dev/null || echo 'not yet')"
;;
stop)
$DC unpause db 2>/dev/null || true
$DC up -d
rm -rf .gameday
echo "all faults cleared"
;;
*) echo "usage: $0 start|reveal|stop" >&2; exit 2 ;;
esacservice.version, a dependency (Redis) gone, a dependency (Postgres) frozen so requests hang until the gateway’s 15 s timeout, and a whole service down. base64 is not secrecy. It keeps an honest responder from reading the answer by accident.2. Everyone: set the baseline and the roles. Start the stack in its normal state and agree who is IC, ops lead, comms lead and scribe. Alone, you are all four; write in the document which hat you are wearing when you act.
cd labs/observability
cat > .env <<'EOF'
OTEL_SDK_DISABLED=false
LOG_FORMAT=json
OTEL_SEMCONV_STABILITY_OPT_IN=http/dup
LOADGEN_RPS=5
PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040
EOF
docker compose --profile telemetry up -d --build
mkdir -p incidents
cat > incidents/live.md <<'EOF'
# Incident: <one line, what customers see>
Status: investigating | mitigated | resolved Severity: SEV-?
IC: Ops lead: Comms lead: Scribe:
Next update due (UTC):
## Current understanding (rewrite this, do not append)
## Timeline (UTC, append only: observation, decision, action, who)
## Status updates sent
## Evidence (trace ids, queries, log lines, file names)
## Follow-ups noticed during the incident
EOF3. Responders: start a detector. If you have the burn-rate alerts and the stand-in pager from earlier in this module, follow the pager in one terminal (docker compose logs -f --no-log-prefix --since 1m pager). Either way, run this in a terminal of its own; it moves minutes before any alert fires. It prints the gateway’s checkout error ratio and p99 every 15 seconds, the two numbers that define severity for the demo app:
q() { curl -sG localhost:9090/api/v1/query --data-urlencode "query=$1" | jq -r '.data.result[0].value[1] // "nan"'; }
while true; do
err=$(q 'sum(rate(http_requests_total{job="gateway",route="/checkout",status=~"5.."}[1m])) / sum(rate(http_requests_total{job="gateway",route="/checkout"}[1m]))')
p99=$(q 'histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{job="gateway",route="/checkout"}[1m])))')
printf '%s error_ratio=%.3f p99=%.2fs\n' "$(date -u +%H:%M:%S)" "$err" "$p99"
sleep 15
done14:02:15 error_ratio=0.000 p99=0.02s. Responders now wait for a change. The facilitator runs ./gameday.sh start in a different terminal and leaves.4. Respond. When the detector moves, run the incident properly:
- The IC declares in
incidents/live.md: one-line description, severity from the table in this chapter, roles. - The comms lead writes the first status update within 5 minutes, then one every 10 minutes (the lab’s compressed cadence), even if it says “no change”.
- The ops lead investigates and is the only one who changes anything. Every change goes in the timeline first.
- The scribe records each observation with its UTC time and the query or trace id it came from.
Investigate with telemetry only. Useful starting points, not answers:
# which service is returning errors, by route and status
curl -sG localhost:9090/api/v1/query --data-urlencode \
'query=sum by (job, route, status) (rate(http_requests_total{status=~"5.."}[1m]))' | jq -r '.data.result[] | "\(.metric.job) \(.metric.route) \(.metric.status) \(.value[1])"'
# which version each service is running, from the OTLP metrics
curl -sG localhost:9090/api/v1/query --data-urlencode \
'query=count by (job, service_version) (http_server_request_duration_seconds_count)' | jq -r '.data.result[] | "\(.metric.job) \(.metric.service_version)"'
# what is up
docker compose --profile telemetry ps --format '{{.Service}} {{.State}} {{.Status}}'In Grafana Explore, LogQL such as {service_name="payments"} | severity_text="ERROR" and {service_name="gateway"} |= "checkout failed", and TraceQL such as { status = error } or { duration > 2s }, take you from symptom to service. Mitigate with compose commands (start, unpause, up -d to recreate a service with .env defaults, which is the lab’s rollback). Verify recovery on the detector before you call it mitigated.
payments /charge with a provider message in the logs; the same plus a service_version of 1.1.0 that appeared a minute before the errors; latency without errors and traces where POST /charge alone is slow; payments returning 500s with Redis connection errors in its logs while docker compose ps shows Redis exited; gateway 502s after almost exactly 15 s with orders unreachable, gateway traces of 15 s in which orders’ part is missing because its spans have not ended, and a docker compose ps line for db that says Paused, which is easy to miss; or orders failing fast because payments is down. A good team gets from first detector line to mitigation in under 15 minutes. Note the time the detector returns to baseline: that is mitigation.5. Close, then reveal. The IC declares the incident resolved and records the time. Then:
./gameday.sh reveal6. Build the timeline from telemetry. Pull the error ratio and p99 at 30-second resolution over the last 45 minutes, and the count of failed checkouts:
end=$(date +%s); start=$((end - 2700))
for q in \
'sum(rate(http_requests_total{job="gateway",route="/checkout",status=~"5.."}[1m])) / sum(rate(http_requests_total{job="gateway",route="/checkout"}[1m]))' \
'histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{job="gateway",route="/checkout"}[1m])))'; do
echo "== $q"
curl -sG localhost:9090/api/v1/query_range --data-urlencode "query=$q" \
--data-urlencode start=$start --data-urlencode end=$end --data-urlencode step=30 \
| jq -r '.data.result[0].values[] | "\(.[0] | floor | todate) \(.[1])"'
done
curl -sG localhost:9090/api/v1/query --data-urlencode \
'query=sum(increase(http_requests_total{job="gateway",route="/checkout",status=~"5.."}[45m]))' | jq -r '.data.result[0].value[1]'injected_at (the 1-minute rate window and the 5 s scrape) and several minutes before anyone wrote “investigating”. The last number is the failed checkouts during the incident, the impact figure for the postmortem’s first paragraph.7. Write the blameless postmortem. Save as incidents/postmortem-template.md and copy it to incidents/<date>-<slug>.md for this incident:
# Postmortem: <title in customer terms>
Date (UTC): Severity: Status: draft | reviewed
Authors: Incident commander:
## Summary
Two or three sentences: what customers saw, for how long, and what stopped it.
## Impact
- Failed checkouts: <n> of <total> (<ratio>) between <start> and <end> UTC
- Latency: p99 peaked at <x> s
- Error budget consumed: <minutes or %>, if you have an SLO
## Timeline (UTC)
| Time | Event | Source (query, trace id, log line, person) |
|---|---|---|
| | Impact begins | Prometheus: error ratio > threshold |
| | Detected | detector / alert name |
| | Incident declared, SEV-? | incidents/live.md |
| | Mitigation applied: <what> | ops lead |
| | Impact ends | Prometheus |
| | Resolved | IC |
Time to detect: <min> Time to mitigate: <min>
## Contributing factors
Several, each with the evidence for it. No names attached to mistakes;
describe what people saw and why their action made sense at the time.
## What went well
## Where we got lucky
## Action items
| Action | Type (prevent / detect / mitigate) | Owner | Priority | Ticket |
|---|---|---|---|---|
## Supporting data
The queries above, trace ids, Grafana links.Before you call it done, run the blameless review over your own draft:
grep -n -i -E "should have|failed to|could have|human error|root cause|careless|forgot" incidents/*-*.mdgrep usually finds two or three phrases on a first draft. Rewrite each as a description of what the person saw and did, and ask what about the system made that the reasonable action. Typical findings from this game day: the page arrived minutes after the loop moved, or, without the pager, there was no alert at all, only a human watching a loop; nothing records deploys, so the version change had to be found by query; and nothing told the responders that the gateway times out at 15 s.8. Reset.
./gameday.sh stopall faults cleared, every container running with .env values, and the detector back to zero errors within a minute../gameday.sh start and note injected_at against the time someone first notices. With slow-payments that can be never: a 30% slice of checkouts at 1.5 to 3 s does not look like an outage to anyone glancing at a dashboard, yet it fails a latency SLO within the hour. Time to detect becomes the largest number in the timeline, and no amount of incident process recovers it. That is the case for the alerting the module’s project builds: people respond, but machines must detect.SEV-2: 8% of checkouts have been failing for 12 minutes. A payments release went out 4 minutes before the errors began. Rolling back takes about 5 minutes and is routine. The payments tech lead is on the call and says: 'Give me 15 more minutes on the live system. If we roll back we lose the repro and we will never find the root cause.' You are the incident commander.
- BOOK Site Reliability Engineering, chapter 14: Managing Incidents Andrew Stribblehill, in Beyer, Jones, Petoff and Murphy (eds.), 2016
The incident roles, the live document, clear handoff and the three tests for declaring, told through an unmanaged and a managed version of the same incident. The source of most of this chapter's process. Read: the whole chapter; it is short.
- BOOK Site Reliability Engineering, chapter 15: Postmortem Culture John Lunney and Sue Lueder, in Beyer, Jones, Petoff and Murphy (eds.), 2016
When a postmortem is required, what makes one blameless, and how Google reviews and shares them. Pair it with the example postmortem to see the format in use. Read: the whole chapter, plus the example postmortem in appendix D.
- POST Blameless PostMortems and a Just Culture John Allspaw, 2012
The short essay that made blameless postmortems mainstream: why blame destroys the information you need, and what accountability means instead. Ten minutes to read; worth re-reading before you facilitate one.
- DOC Debriefing Facilitation Guide John Allspaw, Morgan Evans, Daniel Schauenberg (Etsy), 2016
How to run the postmortem meeting itself: the facilitator's role, the questions to ask, and how to keep a debrief from becoming a trial. Read the sections on questions and on counterfactuals.
- DOC PagerDuty Incident Response documentation
A complete, public incident-response process: severity levels, roles, the incident commander training, update templates and the postmortem template. Steal it wholesale and adapt; read the IC training page first.
- PAPER How Complex Systems Fail Richard I. Cook, 1998
Why there is no single root cause, why hindsight bias distorts every postmortem, and why safety is something operators create continuously. The theory under blameless practice. Read: all 18 points; it fits on two pages.
- DOC Incident Metrics in SRE Štěpán Davidovič, 2021
Shows with simulation that MTTR and similar averages cannot tell you whether incident response improved. Read it before you put MTTR on a quarterly slide.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.