Shelves / Observability and SRE
OB·103
Incident Management
Handling production incidents end to end: what makes alerts good (symptom-based, actionable, urgent, with runbooks), alert routing and on-call design that sustains humans, severity levels, the incident lifecycle (detect, triage, mobilise, mitigate, diagnose, resolve), incident roles and communication, mitigation-first thinking and rollback, diagnosis techniques, root-cause analysis beyond "human error" (contributing factors, 5 whys and its limits), blameless postmortems, action items that actually get done, and incident metrics.
Start here: when something breaks at 3 a.m.
An incident, minute by minute
Steady traffic was flowing through orders → kitchen when the kitchen process was stopped:
20.0s kitchen process stopped (the incident starts)
37.1s notification → pager: FIRING ServiceDown (kitchen) "kitchen is not answering scrapes"
37.1s on-call engineer acknowledges, reads the runbook, decides to restart kitchen
57.1s kitchen restarted (mitigated)
67.1s notification → pager: RESOLVED ServiceDown (kitchen)
pages sent: 1
Every phase of incident management is in those five lines:
- Detect: an alert, not a customer, noticed first. It took 17 seconds: Prometheus scrapes every 2 seconds, the rule waits 10 seconds (
for: 10s) to avoid flapping, and Alertmanager waits 5 seconds to group related alerts. - Respond: a person was paged, acknowledged, and opened the runbook linked in the alert.
- Mitigate: restoring service came first (restart), before anyone knew why kitchen stopped.
- Resolve: the alert cleared by itself once the condition ended.
- Learn: afterwards, a blameless postmortem asks why kitchen stopped, why detection took 17 s, and what would prevent it.
One cause, one page
While kitchen was down, orders was failing too: its own error-ratio alert fired in Prometheus. The pager still received only one page, because Alertmanager was told that "kitchen down" explains "orders errors" (an inhibition rule). With that rule removed, the same incident sent two pages two seconds apart. In a real system with dozens of dependent services, one database failure can otherwise send dozens of pages and bury the one that names the cause.
Mitigate first, diagnose later
During an incident your job is to stop the user pain: roll back the last deploy, restart, fail over, turn off the feature flag, shed load. Finding the root cause can wait until users are fine. Teams that debug before mitigating turn ten-minute incidents into two-hour ones.
How deep to go in incident management
Volume 17 defines six mastery levels. For this chapter they look like this; the chapter aims at L3 everywhere, and its lab at L4.
| Level | What you can do |
|---|---|
| L1 | Explain the incident lifecycle, severities, on-call and blameless postmortems |
| L2 | Respond to an alert with a runbook; write a clear timeline and status update |
| L3 | Configure alert routing, grouping, inhibition and silences; run incident roles |
| L4 | Run game days; measure and reduce detection and mitigation time; fix noisy paging |
| L5 | Design an incident process, severity framework and on-call system for an organisation |
| L6 | Lead major incidents and an organisation-wide learning-from-incidents practice |
Alerting
The principle
The roadmap states it directly: optimise alert quality; do not optimise for the number of alerts. Every page should mean "a human needs to act now, and here's how to start". Alerts that don't meet that bar train people to ignore pages (alert fatigue), which is how real incidents get missed.
A good alert is:
| Property | Meaning |
|---|---|
| Symptom-based | Fires on what users experience (SLO burn, error ratio, latency), not on every possible cause |
| Actionable | There's something the responder can do; if the only response is "wait and see", it's not a page |
| Urgent | Needs attention now; otherwise it's a ticket for working hours |
| Precise | Low false-positive rate (multi-window burn rates, chapter 102) |
| Documented | Links to a runbook, the relevant dashboard and recent deploys |
| Owned | Routes to the team that can fix it |
Symptoms versus causes
- Page on symptoms: "checkout error budget burning 14× too fast", "API p99 above SLO for 10 minutes", "no orders processed in 15 minutes", "synthetic login check failing from 3 regions".
- Ticket (or dashboard) on causes: "CPU 85% on node 7", "one replica down" (redundancy handled it), "disk 70% full".
- Exceptions: page on causes that are imminent and certain to become user-facing and can't wait: disk will be full in 2 hours (
predict_linear), certificate expires in 3 days, backup jobs have failed for 24 hours, the last replica of a database is unhealthy.
Every alert should be reviewed periodically: if it fired and nobody acted, delete it or make it a ticket; if an incident happened without an alert, add a symptom alert.
Alert routing
Alertmanager (Prometheus), Grafana Alerting, and incident platforms (PagerDuty, Opsgenie (being folded into Jira Service Management/Compass), incident.io, Rootly, FireHydrant, Splunk On-Call, Grafana OnCall/IRM) handle:
- Routing by labels (team, service, severity) to the right on-call schedule or channel.
- Grouping related alerts into one notification (50 pods failing = 1 page).
- Inhibition: suppress downstream alerts when an upstream cause is firing (don't page every service when the database is down; page the database owner).
- Silences during maintenance, with expiry.
- Escalation: if the primary doesn't acknowledge within N minutes, page the secondary, then the manager.
# alertmanager.yml (excerpt)
route:
receiver: default-slack
group_by: [alertname, service]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers: [severity="page"]
receiver: pagerduty-by-team
group_by: [service]
- matchers: [severity="ticket"]
receiver: jira-tickets
inhibit_rules:
- source_matchers: [alertname="PostgresPrimaryDown"]
target_matchers: [severity="page"]
equal: [cluster]
On-call
Sustainable on-call is a design problem, not a heroism test:
- Rotations with primary and secondary, usually a week at a time; follow-the-sun across time zones where possible so nobody is paged at 3 a.m. routinely.
- Load limits: Google's SRE guidance aims for at most about two incidents per 12-hour shift, and caps operational work at around 50% of an SRE's time. Track pages per shift; more than that means alerts or systems need fixing.
- Preparedness: access to production tools and dashboards, runbooks, training and shadowing before the first shift, practice through game days.
- Compensation and recovery time after night pages.
- Ownership: "you build it, you run it" puts developers on call for their services, which aligns incentives (alerts and reliability improve when the people who write the code feel the pain).
- Handoffs: a short summary of ongoing issues and recent changes at each shift change.
Severity levels
Severity determines response: who is involved, how fast, and how you communicate. Define it by impact, not by technical cause:
| Severity | Impact | Response |
|---|---|---|
| SEV1 / critical | Major user-facing outage, data loss or corruption, security breach, large revenue impact | Immediate all-hands response, incident commander, executive and customer communication, status page |
| SEV2 / major | Significant degradation or a key feature unavailable for many users; SLO budget burning fast | Urgent response by on-call team, incident channel, status page if customer-visible |
| SEV3 / minor | Limited impact, workaround exists, small subset of users | Handle in working hours, ticket |
| SEV4 / low | Cosmetic, internal-only, no user impact | Backlog |
Declare early and generously: it's cheap to downgrade a SEV2 to SEV3, and expensive to discover an hour into a growing outage that nobody was coordinating. Severity can change as you learn more.
The incident lifecycle
Detect
Ideally your alerts detect the incident before customers do. Track how incidents were detected (alert, synthetic check, customer report, employee); customer-detected incidents point to missing symptom alerts.
Triage and declare
The first responder assesses: what's the impact (who, how many, which journeys), is it getting worse, and what changed recently (deploys, config, flags, traffic, dependency status pages). Then declare an incident with a severity, which starts the process: an incident channel (often created automatically by tooling), a status in the incident tool, and paging further responders if needed.
Mobilise: roles
For anything beyond a small incident, separate roles (adapted from the Incident Command System used by emergency services):
| Role | Responsibility |
|---|---|
| Incident commander (IC) | Coordinates: sets priorities, assigns tasks, makes decisions, keeps the response focused. Doesn't debug. Can hand off when tired |
| Operations / tech lead(s) | Investigate and apply changes, often one per workstream |
| Communications lead | Status page, customer support, stakeholders, executives, on a regular cadence |
| Scribe | Timeline of observations, decisions and actions (tools capture much of this from the channel) |
| Subject-matter experts | Pulled in as needed (database, network, payments provider contact) |
Practices: one incident channel per incident; a pinned summary (impact, current status, next update time); explicit decisions ("we're rolling back orders to v1.4.1, Priya owns it, ETA 5 minutes"); regular status updates ("every 30 minutes even if nothing changed").
Mitigate first
Mitigation restores service; resolution fixes the underlying problem. They're different, and mitigation comes first. Users don't care why it's broken; they care that it works.
Common mitigations, roughly from fastest to slowest:
| Mitigation | When |
|---|---|
| Turn off a feature flag | The incident started with a flag change or a new feature |
| Roll back the last deploy or config change | Anything that started after a change (most incidents do); roll back first, debug later |
| Fail over to another region, zone or replica | Infrastructure or regional failure |
| Shed load / rate-limit / block abusive traffic | Overload, retry storms, attacks |
| Scale up/out | Genuine capacity shortage (but check it's not a symptom of a bug, like a leak or a slow query) |
| Degrade gracefully: disable non-critical features (recommendations, search suggestions) | Protect core journeys while investigating |
| Restart | Last resort for wedged processes; capture state first (thread dumps, heap snapshots) because a restart destroys evidence |
| Hotfix | When none of the above work; goes through the pipeline, ideally fast-tracked |
Rollback deserves emphasis: if an incident correlates with a recent change, roll back without waiting for proof. Make rollback fast, safe and routine (Vol. 6 ch. 84, chapter 96 of Vol. 8), so it's an easy decision at 3 a.m.
Diagnose
Systematic diagnosis beats random poking:
- Scope: which users, regions, endpoints, versions, tenants? Slice metrics by every dimension available. Is it everything (infrastructure, shared dependency) or one slice (a code path, a tenant)?
- Timeline: when exactly did it start? What changed just before? (Deploy, config, flag, traffic shape, dependency, certificate, cron job, data growth crossing a threshold.)
- Follow the request: traces of failing requests; where does time go or errors originate? (Chapter 101.)
- Check resources: USE for each resource on the path; saturation and queues.
- Form hypotheses and test them cheaply ("if it's the new index, rolling back the migration flag should fix p99 within 2 minutes").
- Write down what you've ruled out, to avoid circular investigations.
Resolve and close
The incident ends when service is restored and stable and the immediate risk is gone (sometimes the root cause fix comes later). Close with a final update, record impact (duration, users affected, error budget consumed), and schedule the review.
Communication
- Internal: incident channel for responders; a separate stakeholder channel or email updates for leadership; support teams briefed with what to tell customers.
- External: a status page (Atlassian Statuspage, incident.io, instatus, or self-hosted like Cachet/Upptime) with plain-language updates: what's affected, what we're doing, next update time. Don't speculate on causes before you know; don't go silent.
- After major incidents: a public post-incident report builds trust (many companies publish them).
After the incident
Root-cause analysis
Complex systems rarely fail for one reason. The influential How Complex Systems Fail (Richard Cook) points out that catastrophe needs multiple failures, and that systems run in degraded mode all the time. "Root cause: engineer ran the wrong command" is never a useful conclusion; why was that command possible, easy, and unguarded?
Better framing: contributing factors:
- Trigger: what started it (a deploy, a traffic spike, a config change, an expired certificate).
- Latent conditions: what allowed a trigger to become an incident (no rate limit, missing alert, a single point of failure, a retry policy that amplified load, a runbook that was out of date).
- Detection and response factors: why it took as long as it did to notice and fix.
Techniques:
- 5 whys: keep asking why to go past the proximate cause. Useful, but it tends to produce a single linear chain and stop at a convenient person; ask "what else?" at each level.
- Fishbone (Ishikawa) diagrams: brainstorm causes by category (code, config, infrastructure, process, people, dependencies).
- Timeline analysis: reconstruct what people knew and when, and why their decisions made sense at the time (hindsight makes every mistake look obvious).
- Systems approaches (CAST/STAMP, learning reviews): look at control structures and feedback loops rather than chains of events.
Blameless postmortems
A postmortem (post-incident review) is a written analysis aimed at learning, not blame:
- Blameless means assuming people acted reasonably given what they knew; the question is how the system made the failure possible. Blame makes people hide information, which guarantees repeats. (Blameless isn't consequence-free for negligence, but that's rare and separate.)
- When: every SEV1/SEV2, any incident consuming significant error budget, near misses that could have been serious, and interesting smaller incidents.
- Who: written by people involved, reviewed in a meeting open to anyone interested.
A typical structure:
Title: Checkout errors after payment-client upgrade (SEV2) · 2026-10-21
Summary: 2-3 sentences: what happened, impact, how it was fixed.
Impact: 14:05–14:52 IST; 18% of checkout attempts failed; ~3,100 users; 41% of monthly error budget.
Timeline (IST): 14:03 deploy orders v1.9.0 … 14:05 burn-rate page … 14:19 rollback started … 14:52 recovered.
Contributing factors:
- New payment client defaulted to a 2 s timeout (previously 10 s); fraud checks p99 is 2.4 s.
- Canary analysis only checked HTTP 5xx from orders, not downstream payment failures (returned as 200 + error body).
- Rollback took 14 min because the pipeline re-ran all tests for rollback builds.
What went well: alert fired within 2 minutes; IC assigned in 4 minutes.
What went poorly / where we got lucky: …
Action items:
[P1] Make canary analysis use checkout success rate (business SLI) · owner: Arjun · due: 2026-11-04
[P1] One-click rollback that skips rebuild and tests · owner: Mei · due: 2026-11-07
[P2] Explicit timeouts in payment client config with a test · owner: Sara · due: 2026-11-10
[P3] Return proper error status codes from payment adapter · owner: Raj · due: 2026-11-21
Action items that get done
Postmortems fail when action items rot in a document. Make them work:
- Specific, owned, dated, tracked in the normal backlog with a label; review completion in a regular meeting.
- Prioritised by risk reduction: prefer items that remove a class of failure (automation, guard rails, design changes) over "be more careful" or "add a checklist".
- Balance: detection (would we notice sooner?), mitigation (could we recover faster?), prevention (could this not happen?).
- Share learnings across teams: postmortem reading clubs, searchable archives, recurring themes reported to leadership.
Incident metrics
| Metric | Meaning | Caveat |
|---|---|---|
| MTTD (time to detect) | Start of impact → detection | Improve with symptom alerts |
| MTTA (time to acknowledge) | Page → human acknowledges | On-call health |
| MTTM / time to mitigate | Start → user impact ended | What users feel; the most important |
| MTTR (time to resolve/recover) | Start → fully resolved | Ambiguous: define it |
| Incident count by severity, error budget consumed, % detected by alerts vs customers, pages per on-call shift, action item completion rate | Trends over quarters |
Use these as trends for learning, not targets for individuals. Averages over small numbers of very different incidents are statistically weak (the "MTTR is a misleading metric" critique from the VOID report and others); look at distributions and at the stories in the postmortems.
Lab: a game day with real alerting
A game day is a rehearsed incident: you break something on purpose, under controlled conditions, to test the alerts, the runbooks and the people. This one used the tiffin services under steady traffic (two clients, about 40 orders a second), Prometheus 3.15 (2-second scrapes and rule evaluation), Alertmanager 0.29, and a small HTTP server standing in for a paging service that records each notification with its arrival time. The "on-call engineer" is a script that restarts kitchen 20 seconds after the first page, a stand-in for a person following the runbook.
The alerting setup
# Prometheus alert rules (excerpt)
- alert: ServiceDown
expr: up == 0
for: 10s
labels: {severity: page}
annotations: {summary: "{{ $labels.service }} is not answering scrapes", runbook: "https://runbooks.example/tiffin/service-down"}
- alert: OrdersErrorRateHigh
expr: sum(rate(http_server_errors_total{service="orders"}[30s])) / sum(rate(http_server_request_duration_seconds_count{service="orders"}[30s])) > 0.05
for: 10s
labels: {severity: page}
# Alertmanager
route:
receiver: pager
group_by: [service]
group_wait: 5s # wait for related alerts before the first notification
group_interval: 30s # then batch changes to the group
repeat_interval: 4h # re-notify for still-firing alerts
routes:
- {matchers: ['severity="ticket"'], receiver: tickets}
inhibit_rules:
- source_matchers: ['alertname="ServiceDown"', 'service="kitchen"']
target_matchers: ['alertname="OrdersErrorRateHigh"']
The production values would be longer (scrapes every 15–30 s, for: of minutes, group_wait of 30 s); the lab compresses them so an incident takes a minute.
Run 1: with grouping and inhibition
20.0s kitchen process stopped (the incident starts)
37.1s notification → pager: FIRING ServiceDown (kitchen) "kitchen is not answering scrapes"
37.1s on-call engineer acknowledges, reads the runbook, decides to restart kitchen
57.1s kitchen restarted (mitigated)
67.1s notification → pager: RESOLVED ServiceDown (kitchen) "kitchen is not answering scrapes"
pages sent: 1, tickets: 0
Prometheus ALERTS during the run: ServiceDown (kitchen), OrdersErrorRateHigh (orders)
Run 2: the same incident without the inhibition rule
37.0s notification → pager: FIRING ServiceDown (kitchen) "kitchen is not answering scrapes"
39.0s notification → pager: FIRING OrdersErrorRateHigh (orders) "orders error ratio 48.89%"
57.0s kitchen restarted (mitigated)
67.0s notification → pager: RESOLVED ServiceDown (kitchen)
99.1s notification → pager: RESOLVED OrdersErrorRateHigh (orders) "orders error ratio 5.013%"
pages sent: 2
Run 3: planned maintenance under a silence
20.0s silence created for service=kitchen (id fc26b4d9…) amtool silence add service=kitchen --duration=10m --comment="planned kitchen migration"
20.0s kitchen process stopped
90.1s migration finished, kitchen started
pages sent: 0
Prometheus ALERTS during the run: ServiceDown (kitchen), OrdersErrorRateHigh (orders)
What the runs teach
- Time to detect has parts you control. The 17 seconds from failure to page were scrape interval (up to 2 s) +
for: 10s+group_wait: 5s. With typical production settings (30 s scrapes,for: 5m,group_wait: 30s) the same failure pages after about 6 minutes. Each knob trades noise for speed; choose deliberately per alert, and use SLO burn-rate alerts (chapter 102) for user-facing symptoms. - Time to resolve has a tail you don't see. The kitchen was healthy at 57 s, but the RESOLVED notification came at 67 s (the next group interval), and in run 2 the orders alert took 42 s to resolve because its 30-second rate window still contained errors. Incident timelines should use the times things happened, from telemetry, not notification times.
- Inhibition and grouping cut pages to causes. Run 2's second page added no information. In larger systems, the absence of inhibition (or of
group_byon a shared label such as cluster) is how one database failure becomes forty pages. - Silences hide user impact. Run 3 sent no pages, as intended, but orders was failing for 70 seconds and Prometheus knew it. A silence is right for alerts you expect during maintenance; it's wrong as a substitute for doing maintenance without hurting users (drain traffic first, chapter 104). Give every silence an author, a comment and an expiry, as
amtoolrequires. - Inhibition still works when the source is silenced. In run 3, OrdersErrorRateHigh was inhibited by the (silenced) ServiceDown alert. That's usually what you want, but check it when you rely on a silence for one service.
From the timeline to incident metrics
| Metric | Run 1 | What it measures |
|---|---|---|
| Time to detect (failure → page) | 17 s | Alerting pipeline and thresholds |
| Time to acknowledge | 0 s (scripted) | On-call responsiveness |
| Time to mitigate (failure → service restored) | 37 s | Runbooks, tooling, access, decision-making |
| User impact | ~37 s of failed orders | What the incident cost (the SLO budget burned) |
Track these across real incidents as distributions, not averages, and use them to choose improvements: here, the obvious ones are automatic restart (a supervisor or Kubernetes liveness probe would have mitigated in seconds without a person) and an orders fallback when kitchen is unavailable.
Try it yourself
- Remove
group_by: [service](group everything together) and kill both services. How many notifications arrive, and what do they contain? - Make kitchen slow instead of dead (add a delay) and see whether any alert fires. Which alert is missing?
- Write a five-line runbook for ServiceDown and a postmortem timeline for run 1 using the template in this chapter.
Revision sheet: incident management
Key ideas
- Alerting: page on user-facing symptoms that need a human now; tickets for the rest; every page actionable with a runbook.
- Routing: Alertmanager or an incident platform: grouping, inhibition, silences, escalation, schedules.
- Severities: a shared scale (SEV1–SEV4) tied to user impact and response expectations.
- Lifecycle: detect → triage/declare → mobilise (incident commander, communications, operations, scribe) → mitigate → diagnose → resolve → learn.
- Communication: status page and stakeholder updates on a fixed cadence.
- Postmortems: blameless, contributing factors rather than a single root cause, tracked action items.
- Metrics: time to detect, acknowledge, mitigate, resolve; incident count by severity; repeat incidents.
Numbers to remember
- Lab: 17 s to page (2 s scrapes +
for: 10s+group_wait: 5s); 37 s to mitigate; 1 page with inhibition vs 2 without; 0 pages under a silence while users still saw errors.
Pitfalls
- Paging on causes (CPU) rather than symptoms; unactionable pages; alert fatigue.
- Debugging before mitigating.
- No incident commander in a large incident; everyone debugging, nobody communicating.
- Silences without expiry or comment; maintenance that hurts users.
- Postmortems that blame people, or action items nobody tracks.
Glossary
- Incident commander (IC): coordinates the response; doesn't debug.
- Runbook / playbook: steps for a known alert or scenario.
- Inhibition: suppressing alerts explained by another firing alert.
- Silence: muting matching alerts for a period.
- Game day: a planned exercise that injects failure to test systems and people.