Unit 7 / 11

Incident Management and Postmortem: Root Cause Analysis with Artificial Intelligence

Gains:

  • Ability to understand the life cycle of an incident (detection, triage, mitigation, resolution, postmortem), MTTD/MTTR metrics and the principle of 'mitigate first, investigate later'
  • Ability to use AI to narrow down hypotheses at the time of the incident and produce a blameless postmortem sketch, validating each root cause with data
  • Ability to apply the discipline of writing in a language that does not blame the postmortem and sharing event data by masking it.

Every system breaks down eventually. The difference is how good teams prepare for this inevitable event and how they learn. Incident is an unexpected event that disrupts or threatens to disrupt the service: a service crash, response times skyrocketing, a data loss. Incident management means detecting, mitigating, resolving the incident as quickly as possible, and then learning from it. This is the discipline that drives DevOps and SRE (Site Reliability Engineering) professionals day and night.

Two critical metrics measure the quality of the event: MTTD (Mean Time To Detect) and MTTR (Mean Time To Recover). The goal is to shrink both. AI adds two big values ​​here: quickly summarizing logs and metrics at the time of the event to narrow down the possible root cause, and quickly drafting a postmortem (post-event investigation report) after the event. But the decisions about the course of events - which service to turn off, rollback, what to say to the customer - are yours.

Life cycle of an event

  1. Detection: An alarm sounds or a customer complaint comes. The sooner the better.
  2. Triage: How serious is it? What is the domain? Severity levels are assigned—usually SEV1 (most critical, entire system) to SEV4 (minor).
  3. Assemble your response team. In critical incidents, an incident commander assumes coordination.
  4. Mitigate: Stop the bleeding first — often a rollback or covering a flag. You'll find the root cause later.
  5. Resolve: Apply permanent fix.
  6. Learn (postmortem): What happened, why did it happen, how do we prevent it from happening again?
Tip: One of the most costly mistakes at the time of the incident is delaying stopping the bleeding because "let's get to the exact root cause first." Rule: first decrement (restore/restore service), then inquire. Rolling back to a known-good version is often the quickest mitigation.

Guilt-free postmortem culture

The backbone of healthy teams is a culture of blameless postmortem: the goal is not "who did it," but "what system and process allowed this mistake?" is the question. People hide the mistake if they know they will be punished; The hidden error is repeated. Postmortem is not an accusation report, but a learning document.

A good postmortem includes: summary, impact (how many users, how long, how much money), timeline, root cause(s), what went well/badly, and action items—concrete measures, each with an owner and date.

Caution: When writing postmortems with AI, be sure to eliminate accusatory language (namely “person X made a mistake”). Also mask client IDs, internal IPs, and secrets when feeding event data to the AI ​​— postmortems are often shared widely.

Root cause analysis: 5 Whys and AI

A classic technique is "5 Whys": ask "why?" to a problem. By asking again and again, you get from the superficial symptom to the real root. "The service crashed. Why? Out of memory. Why? There was a leak. Why? A library update..." The AI ​​is quick to build this chain and suggest possible branches — but you must verify each "why" with your data; AI can also build a reasonable but wrong chain.

Severity table

Level

Impact

example

intervention

SEV1

Entire system/critical business loss

Payment dropped completely

Instantly, the entire team, the commander

SEV2

Major dysfunction

Logins failed

Fast, on-call + support

SEV3

Partial/limited effect

A report is delayed

during working hours

SEV4

small/cosmetic

typo

ordinary work queue

three mini cases

Case 1 — MTTR from 45 minutes to 8 minutes. Payment service crashed. The engineer on duty gave the masked logs and the last deployment information to the AI ​​and asked "What is the most likely trigger in the last 20 minutes?" he asked. The AI ​​showed that the collapse started at the same minute as the last deployment. The engineer immediately rolled back that version; The service returned in 8 minutes. The root cause (a connection pool bug in the new version) was then conveniently investigated.

Case 2—postmortem sketch in 20 minutes. After an SEV2, the team was tired and didn't have the strength to write a report; often the report was delayed for weeks. This time, they gave the timeline and incident notes to the AI ​​and produced a crime-free postmortem sketch. AI created a neat framework for impact, timeline and action items; The team filled it with facts and published it in 20 minutes. The lesson was not lost.

Case 3 — wrong root cause caught. In one case, the AI ​​said "root cause database overload" and it seemed reasonable. But the engineer confirmed the metrics: database load was normal at the time of the incident. The real cause was an external DNS problem. The initial hypothesis of AI was fluid but wrong; Validation with data prevented the report from being published with an incorrect conclusion.

Four copyable templates

1) Rapid triage at the time of the incident:

We are experiencing a production event. Masked symptoms: [SYMPTOM].Last changes: [LAST DEPLOY/CHANGE]. Give me:(1) the 3 most likely root cause hypotheses in order of probability,(2) the command/metric that will verify each in 1 minute,(3) the fastest SAFE mitigation step (e.g. rollback).Strictly speaking; State that I must verify each hypothesis.

2) Innocent postmortem sketch:

Write a blameless postmortem sketch from the incident notes below. Sections: Summary, Impact (user/duration/cost), Timeline, Root cause(s), What went well, What went badly, Action items (each with owner + date field). Focus on naming, process and system. Notes: [MASKED]

3) 5 Whys analysis:

Build a "5 Whys" chain, starting with the following symptom: [SYMPTOM].Show if there is more than one possible branch at each step. Next to each "why" write the evidence (log/metric) that I will look at to verify it. At the end, mark which steps have not been verified yet.

4) Creating actionable items:

According to this root cause, suggest actionable items that will prevent the same event from recurring. Classify each item by: (a) prevention, detection or reduction, (b) estimated effort, (c) impact. Sort by highest impact/effort ratio. Root cause: [X]

Weak prompt / Strong prompt

Weak: "The service has crashed, what should I do?"

Result: no context; AI can make general recommendations that don't fit your case, and can even come up with a definitive root cause.

Strong: "The production payment service has been giving 5xx for 5 minutes. The last deployment was 6 minutes ago. Give the 3 most likely root cause hypotheses in order of probability, tell the command that will verify each of them, and suggest the fastest safe mitigation. Don't be specific, state that I need to verify."

Difference: the second prompt gives the symptom, timing, and last change; it demands hypothesis + verification + reduction and keeps AI imprecise.

Common mistakes

  • Looking for the exact root cause before mitigating. It delays stopping bleeding and increases MTTR.
  • Publishing the first hypothesis of AI without verifying it. Fluid but false root causes leak into the report.
  • Accusatory language. Postmortem written anonymously fosters concealment and repeat error.
  • Action-oriented report without bullet points. A proposal without an owner and date will never be implemented.
  • Sharing event data without masking it. Postmortem goes to a wide audience; secret/personal data is leaked.
  • Not preparing the rollback path in advance. If reversal is not practical, reduction is slowed.

In summary

Incident management is about quickly detecting, mitigating, resolving and learning from inevitable events; MTTD and MTTR are key metrics. The golden rule is "mitigate first, investigate later" and reverting to the known-good version is often the fastest mitigation. AI is invaluable in summarizing logs at the time of the event, narrowing down hypotheses, and producing blameless postmortem sketches after the event — but it is your responsibility to validate each root cause hypothesis with data, purge language of blame, and mask event data.

Application task

Consider a past (or fictional) event. (1) Have the AI ​​generate hypotheses and verification steps with the “on-the-scene rapid triage” template; Note which hypothesis can be confirmed by the data. (2) Sketch out a report using the “not guilty postmortem outline” template and fill it with facts. (3) Identify at least two actionable items and assign an owner and date to each.

checklist

  • [ ] At the time of the incident, I first thought of mitigating (rollback/shutdown) and left the root cause until later.
  • [ ] I verified every root cause hypothesis of the AI ​​with log/metric.
  • [ ] I wrote it in a language that does not blame postmortem, focusing on the process and system.
  • [ ] I assigned each actionable item an owner and a date.
  • [ ] I masked the secret and personal information from the event data I gave to the AI.
  • [ ] I assigned the severity level correctly according to the impact.