Instrument every layer, or the failure hides in the one you skipped

An agent failure travels: bad retrieval becomes flawed reasoning becomes a wrong tool call becomes a failed verification. If your tracing covers only one layer, the cause is in one of the layers you did not.

B

Balagei G Nagarajan

4 MIN READ


Five stacked observability layers with one un-instrumented layer dark, hiding the origin of a failure passing through it
Each single-layer view captures a real signal and misses the connection that explains it.
— from “Instrument every layer, or the failure hides in the one you skipped”

Key facts.

  • End-to-end observability covers every step: retrieval, LLM calls, tool invocations, planning, verification, and the cascading effects between them. source
  • Each step generates its own span, nested hierarchically, so a parent trace for the full run contains child spans for every LLM call, tool invocation, memory read/write, and sub-agent handoff. source
  • Handoff spans should capture source and target agent IDs and transfer latency, so the boundary between agents, or between agent and human, stays visible. source
  • Without span-level tracing across all layers, you're running a black box: you detect that something failed, but you can't explain why. source

Why does instrumenting one layer leave you blind?

The layers feed each other, they're not independent. Watch only the LLM calls and you see token usage and outputs, but not that the prompt was wrong because retrieval returned the wrong chunk, and not what the tool did with the model's output. Watch only infrastructure and you see something got slow or errored, but not which reasoning step or tool choice caused it. Each single-layer view captures a real signal and misses the connection that explains it. The failure is a chain. A chain you can only see one link of isn't debuggable, it's a guess.

The human handoff is the layer teams forget most often, and it's where accountability lives. When an agent escalates to a person, or one agent hands to another, that boundary needs its own span, who handed to whom, with what context, after how long, or the trace stops at the edge of the system you instrumented and the rest is invisible.

Swimlane diagram with lanes for retrieval, LLM, tool, verification, and handoff, showing a failure propagating across all five

What does each layer's span need to capture?

Different layers carry different evidence. Retrieval spans record the query and what came back, a wrong chunk is visible. LLM-call spans record the model, input and output tokens, latency. Tool-execution spans record the arguments and result. Verification spans record what was checked and whether it passed. Handoff spans record source and target identities and transfer latency. Nest all of these under one parent trace and the agent's full execution becomes one readable story instead of five disconnected dashboards. Vendor "complete observability" claims are a checklist to verify against your own stack, not a guarantee that every layer is covered.

LayerSpan capturesWhat you lose without it
RetrievalQuery and returned contextWhy the prompt was wrong
LLM callModel, tokens, latency, outputThe reasoning itself
Tool executionArguments and resultWhat the agent actually did
VerificationWhat was checked, pass or failWhether the output was ever validated
HandoffSource/target IDs, transfer latencyThe boundary where it left the system

Full-stack span coverage is the foundation of the Pattern Intelligence Layer. Reliability at the pattern level needs the whole chain, retrieval through handoff, as one trace, so a failure pattern that crosses layers (the retrieval miss that always becomes a tool error, the verification that always gets skipped before a handoff) shows up end to end instead of split across systems that never talk. Instrument every layer. The agent stops being a black box you poke at and becomes a system you can actually read.

Frequently asked questions

Won't the next model just find its own bugs?
A bad retrieval feeds a wrong tool call; cover only the LLM layer and the cause hides. A more capable model can't help: TRAIL pins the faulty step ~11% of the time, so the gap is structural rework. (source)

Isn't tracing the LLM calls the most important part?
Necessary but not enough. The LLM call rarely fails alone, the cause is often an upstream retrieval or a downstream tool. You need every layer to follow the chain.

Why trace human handoffs?
That boundary is where the trace otherwise stops. A handoff span, source, target, transfer latency, context, keeps the story continuous across the edge of the automated system.

How do I know my coverage is actually complete?
Check that every layer emits its own span type and that they nest under one trace. Treat vendor completeness claims as a checklist to verify against your stack.


Share this post

Join the discussion

Have a take, a war story, or a question? Sign in with GitHub to comment and react. Comments are powered by GitHub Discussions, ad-free and yours to moderate.

Continue Reading

Find where your agent breaks, before you build it

Faultmap maps where your agent will fail from the goal and your data, then hands you the first test suite it has to pass.