Use case
How do you approach this?How to Investigate a Production Bug
Published
Quick answer
Investigate a production bug by separating impact management from diagnosis. First protect users and preserve logs, inputs, timing, and deployment context; then form one concrete hypothesis at a time and choose the smallest observation that can change your confidence. A fluent fix proposal may be useful as a lead, but the incident record and reproducible evidence should decide whether it is safe.
Stabilize before explaining
Rate-limit, roll back, feature-flag, or otherwise reduce harm when that is safer than changing code under pressure. Preserve the evidence around the failure before retries, cleanup jobs, or new deployments overwrite it. This gives later debugging a factual starting point instead of a story assembled after the system changed.
Use cheap discriminating checks
List competing explanations and look for the smallest observation that separates them: one request trace, one database row, one version comparison, or one controlled reproduction. Avoid changing several variables at once because an apparent recovery then gives little information about the actual cause.
Practice loop
- 01Record user impact, observed behavior, expected behavior, timestamp, and deployment context before editing code.
- 02List two competing causes and choose the quickest observation that distinguishes them.
- 03After mitigation, add a focused regression check and document the signal that would reveal recurrence.
Limits of this page
This page is a reasoning aid, not incident-response policy for every system. Production work can require escalation, security procedures, rollback authority, and operational knowledge; one diagnostic session cannot explain why an incident was difficult or predict performance under pressure.
Source context
Editorially reviewed for Unrust using public language documentation, common code-review practice, and small original examples written for this resource system.
Check your own starting point
One diagnostic session is a snapshot, not causal proof of why a result occurred. It can help you choose a focused next practice step without making a broader claim about your ability.
Take the free diagnostic