Start with the boundary
Write incident postmortems that improve the system is easiest to get right when the boundary is named before the implementation begins. Decide which system owns the decision, which inputs are trusted, what the caller can observe, and what must remain private. That framing prevents a local optimization from quietly becoming an undocumented protocol.
A postmortem should make the next incident less likely or less damaging. It is not a performance review and it is not a narrative that ends when service recovers. Capture what users experienced, what the team knew at each point, which controls failed, and which changes will be verified after the document is published.
Model the system before choosing a tool
Use a consistent structure: impact, detection, timeline with time zones, contributing conditions, response, recovery, what went well, what made the incident harder, and actions with owners. Separate trigger from root conditions. Include dependencies, process gaps, and misleading signals. Link dashboards, logs, revisions, and changes without copying sensitive data into a permanent document.
Write the model down as a small state diagram or table before selecting a library. Identify the durable state, the derived state, and the transitions that may be retried. This makes it easier to compare a managed service with an in-process implementation and to explain why a particular trade-off is acceptable for this workload.
Design for failure, misuse, and change
A vague action such as improve monitoring, an owner without a due date, and a fix that only addresses the trigger create the appearance of learning. Blaming one operator hides design conditions and discourages reporting. A postmortem that omits near misses or customer support evidence cannot explain the full impact.
A resilient design assumes that inputs are incomplete, dependencies are slow, operators make mistakes, and requirements will change. Put limits at the boundary, return errors that a caller can act on, and preserve enough context to distinguish a bad request from an unavailable dependency. Avoid broad fallbacks that make an unsafe state look successful.
Implementation example
Freeze a timeline from source timestamps, then mark estimates and unknowns. Quantify affected requests, tenants, duration, data exposure, and recovery work. For each action, state the control it adds, how it will be tested, and what signal proves it works. Include a small regression test or runbook change where possible.
Keep the first implementation narrow enough to review line by line. Make inputs, outputs, authorization context, and failure behavior explicit instead of hiding them behind a convenience helper. The example should be safe to run with synthetic data, emit a correlation identifier, and leave a durable artifact that another engineer can inspect after the request has finished.
impact: 42 minutes of elevated 5xx
detection: alert at 14:03 UTC
owner: add idempotency regression test by 2026-07-25
proof: CI test and replay drillVerify and troubleshoot
Review the draft with responders and an independent engineer. Check that each timeline event has evidence, that the impact calculation is reproducible, and that actions are neither duplicates nor placeholders. After completion, run the new test, alert, or rollback drill and link the result to the postmortem.
Use a small test matrix that covers the ordinary path, an empty or missing input, a duplicate request, a timeout, a permission failure, and a version mismatch. Assert both the response and the side effects. When a test fails, compare the observed transition with the model rather than adding a retry or widening a timeout without evidence.
Operations and recovery
Track action age, overdue risk items, repeated incident themes, and whether changes survive future releases. Share a concise public summary when customers were affected, without exposing private details. During a new incident, consult prior postmortems for controls and avoid reopening settled blame debates.
Give the operator a bounded recovery action: replay a safe event, rebuild a derived view, rotate a credential, drain a queue, or roll back a compatible revision. Record the owner, retention period, alert threshold, and rollback condition next to the implementation. A runbook is useful only when it can be followed without reconstructing the design from production logs.
A practical decision guide
For a small service, prefer the design with the fewest hidden states that still meets the operations requirement. Add a managed dependency when it removes a failure mode you can measure, not simply because it is popular. Keep the interface replaceable by isolating provider-specific code behind a narrow adapter and by testing the behavior your users depend on.
Revisit the decision when traffic shape, data sensitivity, team ownership, or recovery objectives change. A design that is excellent for a single tenant or a low-volume internal tool can be the wrong design for a public multi-tenant path. Record the assumptions so the next change starts with evidence rather than folklore.
An implementation checklist
Before publishing a change related to write incident postmortems that improve the system, write down the input contract, authorization context, state transitions, limits, and user-visible errors. Identify the smallest synthetic dataset that demonstrates the normal path and the smallest dataset that demonstrates the dangerous path. Add a correlation ID to the example, make retries deliberate, and decide which artifacts can be retained for support without copying secrets or unnecessary personal data. This checklist is deliberately boring: repeatable release evidence is more valuable than a clever demo.
Use a disposable environment to exercise the implementation with realistic concurrency and a dependency failure. Compare the observed result with the contract, then record the measured latency, resource use, and recovery action. If a managed service or library is involved, pin its version and capture the relevant configuration. Ship behind a reversible change when the behavior is new, and schedule a follow-up review after real traffic reveals assumptions that a test fixture could not.
References and further reading
Use established incident-management practices, SRE literature, and your organization's privacy and customer-communication policy. Treat the postmortem repository as operational knowledge with access and retention rules.
Prefer primary protocol specifications, vendor security documentation, and measured behavior from a disposable environment. Read the failure and deprecation sections, not only the happy-path quick start. A short reference list attached to the code gives future maintainers a way to distinguish an intentional constraint from an accidental implementation detail.