By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
At 02:14 the claims extraction service starts returning an empty claim total on 12% of documents. The on-call engineer is a capable backend developer new to the extraction prompt.
She does what most engineers do: she pastes the night's four-thousand-line log into Claude Code and asks for the cause. The assistant finds a plausible bug in a parser function and proposes a patch. That function is not in the failing path. The real cause is a renamed upstream field.
The assistant was not wrong about the code. It was starved of the one artifact that named the failure, and flooded with one that did not.
A trace is the record of one request from start to finish. It holds each step in order, with every tool call's input and output, the model call, the latency and the error. A log line is one event. A metric is a number over time.
| Artifact | The question it answers | What it cannot tell you |
|---|---|---|
| Metric | Is something wrong, and how widespread is it? | Which step failed, or why |
| Trace | Where did this request break, and with what input? | Whether other requests share the cause |
| Log | What happened around the failure, in order? | Which request it belonged to, unless correlated |
| Deployment record | What changed, and when? | Whether that change caused the failure |
The trace is the unit of debugging, because it carries the failing input. An assistant can test a hypothesis about a schema only when it can see the payload that broke.
An incident brief is a short file the on-call engineer maintains during the incident. It holds the trace id, the failing step, the last change, the affected scope, the current hypothesis and the read-only constraint.
Update the brief every fifteen minutes, or whenever the scope moves. Stale context is worse than none, because the agent reasons confidently about a system that has changed.
A runbook written for a person reads as advice. A runbook for an agent reads as checks with expected results, so it can act without inventing a procedure.
Name the symptom in the words the alert uses.
Give the first check as a command with an expected result.
List the two or three known causes and the check that separates them.
Say when to stop diagnosing and escalate.
Add the change that closed the last incident.
Teams skip the fifth item. A runbook that never learns from an incident describes the first one.
Escalation is handing the incident to a person or team with more authority or more context. The decision should be a rule, not a judgement made at three in the morning.
Conditions work better than a clock. A time trigger is easy to write and often too late for a data problem, because the write already happened.
Reconstruct the incident with the facts you have: empty totals on 12% of documents, an upstream schema rename, a four-hour resolution.
You can now give an agent a small, current context and get a diagnosis instead of a guess.
Key takeaways
A trace is the unit of debugging: one request, its steps, its tool inputs and its error.
Metrics show that something is wrong, traces show where, and logs show what happened around it.
Keep an incident brief with one trace, the last change, the scope and a read-only constraint.
A runbook for an agent states checks with expected results, not advice.
Set escalation triggers as conditions, not only a clock, and review where the agent was confidently wrong.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.