Course contents

13. Observability Lesson 6 of 6

Incident Investigation

From page to cause: triage, rule out the recent deploy, follow traces and logs to a slow payment provider, mitigate with failover, then a blameless review.

15 minIntermediate8 steps
Loading the interactive simulation…
Loading the knowledge check…

Summary

  • Know normal first: RED dashboards per service and per dependency, deploy history, linked traces and logs.
  • Page on user-facing symptoms; then organise: a commander, someone on communication, a clear scope.
  • Errors spread evenly over all instances point at something shared downstream.
  • Mitigate before root cause: a cheap rollback that does not help still rules a hypothesis out.
  • Follow the time to the dependency where waiting ends; fail over, then fix the system in a blameless review.
Deep diveHow it works, trade-offs, failure modes, misconceptions and the interview angle.

What it is

Incident investigation is the work between "users are hurting" and "users are fine and we know why": detecting the problem, organising a response, restoring service, and finding the cause. It is a process as much as a technical skill, and it relies on the signals (metrics, logs, traces) being in place before anything breaks.

Why it exists

Every production system fails eventually. What decides the impact is how fast you notice, how fast you restore service, and whether you learn enough to prevent a repeat. Without a practised process, teams debate root causes while users wait, or several people change things at once and make it worse.

How it works

Detect. Alert on symptoms users feel, ideally SLO burn rates, rather than on every possible cause. Compare against known baselines: RED metrics per service and per dependency, deploy and config history.

Organise. Declare an incident, name an incident commander who coordinates and decides, someone for communication (status page, stakeholders) and the people investigating. Keep a running timeline.

Scope. One instance or all? One route, one region, one customer segment? Errors spread evenly over all instances point at something they share: a dependency, a config pushed everywhere, the network. A single bad instance stands out in a per-instance breakdown.

What changed? Most incidents follow a change: deploys, config, feature flags, traffic patterns, dependency changes. If a change is plausible and reverting it is cheap and safe, revert first. A rollback that does not help is still useful: it rules a hypothesis out quickly.

Follow the time. Traces show where the waiting ends; dependency latency and saturation metrics confirm it; logs filtered by trace id show the exact errors. Look for the component with high self time or a saturated resource, not the one that merely reports the highest latency.

Mitigate. Restore service before fixing the root cause: roll back, fail over to a secondary provider or region, disable a feature flag, shed load, add capacity where it is the bottleneck. Runbooks list these steps for known failure modes.

Resolve and review. Once stable, fix the root cause and write a blameless postmortem: timeline, impact (for example, error budget spent), contributing factors, what went well, and action items with owners.

When to use it

For any user-visible degradation, including partial ones (one region, one feature, elevated latency). Declaring an incident early is cheaper than declaring it late; you can always downgrade.

When not to

  • Not every alert is an incident: a single retried failure or a noisy alert needs tuning, not an incident bridge.
  • Avoid deep root-cause analysis while users are still affected, unless it is the fastest path to mitigation.

Trade-offs

Choice You gain You pay
Roll back first Fast restoration, quick elimination of a hypothesis Delays the fix that was in the release
Fail over to a secondary Service restored despite an external cause Cost of a standby, maybe slower or pricier path
Declare incidents early Coordination before confusion Occasional false alarms
Strict incident roles Clear decisions, less chaos Overhead for small issues
Detailed postmortems Lasting fixes, shared learning Time spent writing and reviewing

Alternatives

  • Automated remediation (auto-rollback on canary failure, circuit breakers with automatic failover) handles known failure modes without humans.
  • Chaos engineering and game days rehearse incidents in advance so the real one is familiar.
  • AIOps / anomaly detection can suggest correlations, but still needs humans to validate causes and decide mitigations.

Failure modes

  • Hero debugging: one person digging alone while nobody communicates or coordinates.
  • Root cause before mitigation: users wait while the team proves a theory.
  • Too many cooks: several people change things at once; the effect of each change is unknowable.
  • Fixing the symptom where it shows: adding capacity to a saturated service whose workers are waiting on a slow dependency only lets more requests wait.
  • Blameful reviews: people hide information next time, and the system's gaps stay.
  • Action items nobody owns: the same incident recurs.

In production

Keep on-call rotations with clear escalation, alerts linked to runbooks, dashboards per user journey and per dependency, a deploy timeline overlaid on graphs, and trace links from logs and exemplars. Practise with game days. Track time to detect and time to mitigate, and follow up on postmortem actions.

Common misconceptions

  • "First find the root cause." First restore service; root cause can wait an hour, users cannot.
  • "The deploy is always the cause." Often, but check timing and scope; roll back if cheap, then move on.
  • "The busiest service is the culprit." A saturated service may just be waiting on its dependency.
  • "A postmortem finds who made the mistake." It finds where the system made the mistake easy and the impact large.

Interview angle

Asked "the site is slow, what do you do?", walk through: check the SLO dashboard and scope, look for recent changes, mitigate (rollback, failover, shed load), then use traces, dependency metrics and logs to find the cause, and finish with a blameless postmortem and preventive measures such as timeouts, circuit breakers, bulkheads and alerting on dependency latency.

Model assumptions

Simulated: two API servers (16 workers, 20 ms, 10 waiting), a Payments service (16 workers, 15 ms, 8 waiting) and an external payment provider (32 workers, 80 ms, 30 ms away); callers hold a worker while they wait. The degraded provider is 6× slower (480 ms per call); the backup provider takes 100 ms. Errors, latencies, saturation and span durations in the text come from the simulation. The alert, the deploy history, incident roles, log lines and the trace walk-through are annotations and scripted packets; there is no per-call timeout in the model, which is why the postmortem recommends one. Arrivals are Poisson, service times lognormal. Numbers show behaviour, not benchmarks.

The lesson as textEvery step of the simulation, written out.
  1. 1. Know what normal looks like

    Users send about 50 checkouts a second. Each goes through the load balancer to one of two API servers, then to the Payments service, which calls an external payment provider (PSP). A checkout takes about 230 ms and none fail.

    Investigations start long before the incident: a dashboard with the RED signals for each service and each dependency, a deploy history, and traces and logs that share an id. Remember these numbers; in a moment you will compare against them.

    Scene: Users send about 50 checkouts per second through a load balancer to two API servers, which call the Payments service, which calls an external payment provider. Requests take about 230 ms and none fail.

    Key idea: You can only spot "abnormal" if you know "normal": baseline dashboards per service and per dependency.

  2. 2. The page

    One second in, something changes. Within a few seconds P50 climbs past half a second and P95 to about a second, and the error tile shoots up to roughly 40%. The SLO burn-rate alert pages the on-call engineer.

    The alert says *users are failing*, not *why*. That is by design: page on symptoms users feel, then investigate causes. The clock is now running.

    Scene: Shortly after the change, median latency rises past half a second, P95 to about a second, and the error rate climbs to roughly 40%. A burn-rate alert pages the on-call engineer.

    Key idea: Page on user-facing symptoms (SLO burn), not on every possible cause.

  3. 3. Triage: roles, scope, blast radius

    First, organise: declare an incident, name an incident commander (coordinates, decides) and someone on communication (status page, stakeholders), so the people debugging can focus.

    Then scope it. Is it one host or all? The per-instance dashboard shows errors on API 1 and API 2 in about equal numbers, and the load balancer’s health checks still pass for both. A bad host would stand out; an even spread across every instance points at something they share, downstream.

    Scene: Errors continue. They are spread evenly over both API servers, and both still pass their health checks.

    Key idea: Organise first (commander, comms), then scope: one instance, one route, one region, or everything?

  4. 4. What changed? Mitigate first

    The most common cause of incidents is a change. The deploy history shows API v142 went out 25 minutes ago. The timing is not a great match, but rolling back is cheap, fast and safe, so the commander orders it now instead of debating: mitigate first, find the root cause later.

    Both API servers are back on v141. The error tile does not move. That is still progress: one hypothesis is ruled out in a minute, and the team turns to the dependencies.

    Scene: Both API servers are rolled back to the previous version. The error rate and latency stay the same, so the deploy was not the cause.

    Key idea: If a recent change is plausible and rollback is cheap, roll back first. A rollback that does not help rules a cause out.

  5. 5. Traces point downstream

    Open a few traces. The slow successes look alike: the API span waits on Payments, and Payments’ span is one long wait on its call to the payment provider, about half a second. The failures are short: Payments answered 503 straight away because it had no free worker and its queue was full. Watch the two scripted traces: one slow success, one rejection.

    The dependency dashboard agrees: the provider’s calls take about six times their usual 80 ms, and Payments has every worker busy waiting for it, with a full queue behind them. The provider itself has spare workers; Payments is stuck holding its own while it waits.

    Scene: Two traces: a slow checkout waits about half a second for the payment provider before succeeding; the next one is rejected by Payments straight away. Payments has all workers busy waiting on the provider and a full queue.

    Key idea: Follow the time: traces show which dependency the waiting ends at.

  6. 6. Logs confirm the mechanism

    Search the logs by one failing trace id. Payments logged that it rejected the request with 503, queue full; the API logged the 503 from Payments and returned an error. Grouped by where the error started, every failure begins at Payments, and the successful requests’ Payments log lines show provider calls of around half a second.

    The provider’s status page, checked last, confirms degraded performance in its region. Your logs had said so a few minutes earlier.

    Scene: Payments logs show slow provider calls and rejected requests. Every failure starts as a 503 from Payments, whose workers are all waiting on the slow payment provider.

    Key idea: Logs confirm the mechanism (which call, which error, how often) once traces and metrics have narrowed the search.

  7. 7. Mitigate: fail over to the backup provider

    The cause is outside your control, but the impact is not. Payments is switched to the backup payment provider (the runbook step for exactly this). Its calls take about 100 ms, a little slower than the primary’s normal 80 ms.

    Payments’ workers free up, the queues drain, the errors stop and P95 settles slightly above the baseline. The incident is mitigated: users are fine again even though the primary provider is still broken.

    Scene: Payments now calls the backup payment provider. The queues drain, errors stop and P95 latency settles slightly above the baseline, while the primary provider is still degraded.

    Key idea: Mitigation restores service (failover, rollback, shedding, flags); the root-cause fix can wait until users are safe.

  8. 8. After the incident: a blameless review

    Write the timeline while it is fresh: first impact, page, roll back (ruled out the deploy), traces, failover, recovery. Then ask why it hurt this much: Payments waited for the provider as long as it took, and one slow dependency held every Payments worker.

    Typical action items: a timeout on provider calls, a separate worker pool (bulkhead) for them, a circuit breaker with automatic failover, an alert on dependency latency, and a runbook link in the alert. The review is blameless: it looks for gaps in the system and the process, not for a person to blame.

    Scene: The system runs on the backup provider; the primary provider is still degraded but out of the request path.

    Key idea: Detect, triage, mitigate, then learn: a blameless postmortem turns the incident into concrete fixes.