Reliability and security · L2Debugging production

Debugging production

When production breaks, first stop the harm, then find the cause with data, one hypothesis at a time.

L2 SeniorReliability and security20 min read
Fact-checked by AI against cited sources · Human review pendingLast reviewed 21 Oct 2026 · How we check content
Section 1 of 8

What broke

On 18 November 2025 at 11:05 UTC, Cloudflare changed the access rights on one of its databases. From 11:20, its network began to fail to deliver core traffic. Many websites behind Cloudflare showed error pages. 1

An automated test caught the problem at 11:31. At 11:35 the team opened an incident call. 1

The team first thought it was a huge DDoS attack. Two things pointed that way. Cloudflare had recently fought a wave of very large attacks. And its status page, which runs outside Cloudflare, went down at the same time. That was a coincidence, but it made some people think an attacker was hitting both. 1

The errors were strange, too. The network failed, recovered, then failed again. The real cause was a file of bot features that was rebuilt every five minutes. The database cluster was being updated step by step, so each run could make a good file or a bad one. 1

The bad file came from the database change. A query started to return duplicate rows, so the file doubled in size. The proxy had a limit of 200 features and normally used about 60. The bigger file went over the limit, and the proxy failed. 1

At 14:24 the team stopped making new files, and a test with an older file worked. By 14:30 core traffic was mostly flowing again. Every service was back at 17:06. 1 Note what misled them: a coincidence, and a symptom that came and went.

Section 2 of 8

The idea in simple words

In production, real users are hurting while you debug. So you have two goals, in this order:

  1. Stop the harm. This is called mitigation.
  2. Find the cause. Then fix it so it does not come back.

Google's SRE book says that in a big outage, you may want to start hunting for the root cause at once. Its advice: "Ignore that instinct!" Instead, make the system work as well as it can for now. 2

After that, use a loop. Look at the data. Make one guess, called a hypothesis. Test it. If the test says no, make the next guess. The book calls this the hypothetico-deductive method. 2

The key idea. Mitigate first, debug second. Then let data, not the loudest opinion, choose between hypotheses, and test them one at a time.

Section 3 of 8

How it works

Step through one incident from the alert to the postmortem.

Debugging a production incident: stop the harm first, then find the cause1 · Alert firescheckout errors0.2% → 6% 2 · Mitigate firstroll back, flag offor shed load 3 · What changed?deploys · configtraffic · dependencies 4 · One hypothesisa guess that a testcan prove wrong 5 · Test itsplit by version,region, tenant, time 6 · Root cause foundoften severalcauses together 7 · Postmortem actionseach fix has anowner and a date SeniorPath
  1. An SLO alert pages you. The error rate on checkout has jumped from 0.2% to 6%. Users are failing to pay right now.
  2. Do not hunt for the cause yet. First make users safe: roll back the last deploy, turn off a feature flag, or shed load. Keep some logs and one bad host for later.
  3. Ask what changed just before the errors started. Look at deploys, config and flags, traffic, and the services you depend on.
  4. Pick the most likely explanation and write it down as one hypothesis. A good hypothesis says what you should see if it is true.
  5. Test it. Split the errors by version, region, tenant or time. If the data says no, go back and try the next hypothesis. A clear no is useful too.
  6. The data agrees, and you can explain the whole story. Often it is not one cause but several conditions that met at the same time.
  7. Write a blameless postmortem. Each action, like a validation check or a kill switch, gets an owner and a date, so the same failure is less likely to come back.
Step 1 of 7

1. Stop the bleeding

The fastest safe action is usually one of these:

  • Roll back the last deploy or config change. In one Google emergency, an engineer pushed another config change to roll back the first one, and services began to recover. 3
  • Turn off a feature flag for the new code path.
  • Shed load or move traffic. The SRE book gives examples: send traffic away from a broken cluster, or turn off subsystems to reduce load. 2

Fast action can still save evidence, such as logs. 2 Take a minute to save logs, a heap dump, or one bad host out of traffic. If you feel overwhelmed, pull in more people. 3

2. Ask "what changed?"

A system tends to keep running until something acts on it, such as a config change or a new kind of load. So start with recent changes. 2 Check four kinds:

  • Deploys: code, images, OS updates.
  • Config: settings, feature flags, firewall rules, generated data files.
  • Traffic: a spike, a new customer, a bot, a new client version.
  • Dependencies: databases, caches, cloud services, other teams' APIs.

In the Cloudflare story, the change was in a database, not in the proxy that failed. 1 So look beyond your own service.

3. Read the right signals

The observability lesson covers metrics, logs and traces. Two short checklists tell you where to look first.

The RED method is for services. For each one, check rate (requests per second), errors (how many fail) and duration (how long they take). 7

The USE method is for resources like CPU, memory, disks and network. For every resource, check utilization, saturation and errors. 6 Saturation means extra work the resource cannot handle yet, often waiting in a queue. 6

Tom Wilkie, who created RED, says RED cares about how happy your users are, and USE about how happy your machines are. 7 Start with RED to find the service that hurts, then use USE on its machines.

4. Test one hypothesis at a time

Write each hypothesis down, for example: "The new connection pool is too small." Say what data would prove it wrong.

Test the most likely idea first, and think about risk to the system: "when you hear hoofbeats, think of horses not zebras." 2

Take notes on each idea, each test and each result. Do not ignore a clear "no": negative results are useful too. 2

5. Narrow it down

Split the problem in two, again and again. The SRE book calls this divide and conquer, or bisection. 2 You can split by:

  • Time: what happened in the minute before the first error?
  • Region or zone: is one region bad and the others fine?
  • Version: do errors come only from hosts on the new build?
  • Tenant: is it one customer, one card type, one app version?

Each good split roughly halves the search.

6. Follow one request

Metrics tell you that something is wrong. A trace and its logs show what happened to one request. When service A calls service B, A sends a trace ID and a span ID with the call, in the W3C traceparent header. 8 OpenTelemetry can add these IDs to your log records. 9 The trace ID then works as a correlation ID: search for it and see that request's logs in every service.

Safe experiments in production

Sometimes you must test in production. Change one thing, on one host or a canary, and know how to undo it. Such tests can also change the results of the next test. 2

Common traps

The SRE book lists traps that send teams the wrong way. 2

  • Wrong symptoms: looking at metrics that do not matter, or misreading what a metric means.
  • Old causes: "it happened once, so it must be happening again."
  • Coincidences: two things that move together by chance.

Add two more. Confirmation bias means you see only the data that fits your first idea. Chasing the loudest symptom means you fix the error that fills the logs, not the one that came first.

The worst trap is many people changing things at once. Google tells of an engineer whose change, made without telling anyone, made an outage worse. Its rule: only the operations team changes the system during an incident. 4

Incident roles

Google uses clear roles. 4

  • The incident commander holds the overall picture and gives out the work.
  • Operations makes the changes.
  • Communication sends regular updates to people outside the call.
  • Planning handles longer jobs, like filing bugs and handing over to the next shift.

PagerDuty adds: "the Incident Commander is NOT a resolver." 10 The commander leads; experts fix.

The blameless postmortem

A postmortem is a written record of an incident: its impact, the actions taken, the root causes and the follow-up steps. 5 A blameless postmortem looks for the contributing causes "without indicting any individual or team." 5 As Google puts it, you cannot fix people, but you can fix systems and processes. 5

Blame makes engineers stay silent, and silence makes incidents longer. 11 So ask "what" and "how", not "who" or "why". 11

Cloudflare's follow-up list is a good example: check its own generated config files like user input, and add more global kill switches. 1

Section 4 of 8

Trade-offs

OptionSpeedRiskUse it when
Roll backYes Minutes, if automated.Low, unless data or schema changed too.A change lines up with the start of the errors.
Roll forward (ship a fix)No Write, review, deploy.Medium. A rushed fix can add a bug.Rollback is impossible, like after a one-way migration.
Turn off a feature flagYes Seconds.Low, if the "off" path was tested.The new code is behind a flag.
Shed load or move trafficYes Minutes.Medium. Some users fail on purpose.Overload, or one region is broken.
Wait and investigateNo Users keep failing.High for users.Impact is small and stable, and quick actions could make it worse.

Simple rule: if a change lines up with the start of the errors, undo it first and ask questions later.

Section 5 of 8

At work: how a senior uses this

  • Ask in the first five minutes: "Are users hurting? What changed in the last hour? How fast can we undo it?"
  • Make rollback and flag-off a single, tested command. Practise it on a quiet day.
  • Keep one timeline in the incident channel: each change, hypothesis and test, with the time.
  • Say hypotheses as "I think X, because Y. If I am right, we will see Z." When a theory fits too well, look for data that would break it.
  • Write the postmortem within a few days. Name systems and gaps, not people. Give every action item an owner and a date.
Section 6 of 8

With AI

What to ask the agent

"Here are 2,000 log lines from the checkout service between 14:00 and 14:20. Group the errors by type. For each group, give the count, the first time it appeared and three example trace IDs."

"Here is our deploy log and config history for the last 24 hours. List every change that happened in the 30 minutes before 14:05."

"Draft a blameless postmortem from this incident channel export. Use 'the on-call engineer', not names. Mark every claim you could not find in the export."

What to check yourself

  • Every cause the AI gives is only a hypothesis. It can sound sure and still be wrong. Ask for the exact log lines, then open them yourself.
  • The counts and times match your dashboards. Summaries can drop or merge errors.
  • The AI saw the whole time window, not just the part that fit in its context.
  • No secrets or personal data went into the prompt.
  • You still do the reasoning. In Anthropic's January 2026 trial, 52 mostly junior engineers learned a new Python library, Trio. One group had an AI assistant. The AI group scored 50% on the quiz and the hand-coding group 67%. The biggest gap was on debugging questions. 12 People who asked for explanations and conceptual answers learned more. 12 The study was small and tested learning only shortly after the task. 12
Section 7 of 8

Check yourself

1. Checkout errors jump from 0.2% to 6% ten minutes after a deploy. What do you do first?

Show answer

Roll back the deploy, then investigate with the logs you saved. Stop the harm first. A rollback is fast and usually safe, and you can find the bug after users are fine.

2. Errors come only from servers running version 4.2. Servers on 4.1 are fine. What have you just done?

Show answer

Bisected the problem by version. Splitting the traffic into two groups narrows the search. It does not yet prove the cause, but it tells you where to look.

3. Which method gives you rate, errors and duration for each service?

Show answer

The RED method RED is for services and their requests. USE checks utilization, saturation and errors for resources like CPU and disks.

4. During an incident, three engineers each try a different fix at the same time. Why is this a problem?

Show answer

You cannot tell which change helped or hurt, and changes can make the outage worse. Google's SRE book says only the operations team should change the system during an incident, so every change is known and coordinated.

5. An AI assistant reads your logs and says, "The root cause is a memory leak in the cache." What should you do?

Show answer

Ask which log lines prove it, then check them and test the idea yourself. AI can summarise logs well but can also give a cause that sounds right and is wrong. Treat it as one hypothesis to test.

Your progress is saved only in this browser. Export it to keep it safe.

Was this clear?
Report a mistake (opens GitHub in a new tab)
Section 8 of 8

Go deeper

Show 12 sources and related lessons
  1. Cloudflare, “Cloudflare outage on November 18, 2025” (official postmortem) (opens in a new tab)
    The full timeline, the wrong first theory of a DDoS attack, and why the errors came and went.
  2. Chris Jones, “Effective Troubleshooting”, Google, Site Reliability Engineering, chapter 12 (opens in a new tab)
    The troubleshooting loop, "stop the bleeding" first, recent changes, bisection and the common traps.
  3. Corey Adam Baye, “Emergency Response”, Google, Site Reliability Engineering, chapter 13 (opens in a new tab)
    Real Google emergencies, including a config change that was fixed by rolling it back.
  4. Andrew Stribblehill, “Managing Incidents”, Google, Site Reliability Engineering, chapter 14 (opens in a new tab)
    Incident roles, the danger of people changing things on their own, and when to declare an incident.
  5. John Lunney and Sue Lueder, “Postmortem Culture: Learning from Failure”, Google, Site Reliability Engineering, chapter 15 (opens in a new tab)
    What a blameless postmortem is, when to write one, and how to make action items stick.
  6. Brendan Gregg, “The USE Method” (opens in a new tab)
    A checklist for resources such as CPU, memory, disks and network.
  7. Grafana Labs, “The RED Method: How to instrument your services” (Tom Wilkie's method) (opens in a new tab)
    Rate, errors and duration for every service, and how RED differs from USE.
  8. OpenTelemetry documentation: Context propagation (opens in a new tab)
    How a trace ID moves from one service to the next in the traceparent header.
  9. OpenTelemetry documentation: Logs (opens in a new tab)
    How log records carry the trace ID and span ID, so logs and traces line up.
  10. PagerDuty Incident Response documentation: Different Roles (opens in a new tab)
    What the incident commander, scribe, experts and liaisons each do.
  11. PagerDuty Postmortem documentation: The Blameless Postmortem (opens in a new tab)
    Why blame makes incidents longer, and how to ask questions without blame.
  12. Anthropic, “How AI assistance impacts the formation of coding skills” (29 January 2026) (opens in a new tab)
    A trial with 52 mostly junior engineers learning the Trio library. The AI group scored lower, most of all on debugging questions.

Real incident: Cloudflare, 18 Nov 2025: Cloudflare outage: a feature file grew too big

Real incident: Roblox, 28 Oct 2021: Roblox outage: 73 hours down after Consul broke

Case studies: Stripe: Canonical log lines: one rich log line per request

Related: Observability, SLOs and error budgets · Safe deploys and config changes · Incident response and postmortems · Distributed tracing in practice · Feature flags and entitlements · Skill atrophy and deliberate practice (coming soon)

Term

See full entry

Jump to a section

  1. 1What broke
  2. 2The idea in simple words
  3. 3How it works
  4. 4Trade-offs
  5. 5At work
  6. 6With AI
  7. 7Check yourself
  8. 8Go deeper