Two runs of the same agent, same prompt template, same model. One comes back fast enough that nobody notices. The other takes long enough that someone files a ticket. Neither errored. The average on the dashboard still looks healthy. And nobody on the team can say which part of the slow run was slow, because the run was dozens of spans deep and only the outermost one was ever measured.
That is the ordinary condition of agent systems in production. Latency stops being a property of a request and becomes a property of a chain: planning, retrieval, tool calls, model calls, sub-agent handoffs, each waiting on the one before it. Anthropic’s engineering team reported in June 2025 that moving from sequential to parallel sub-agent execution cut research time by up to 90% on complex queries – the same work, reorganized in time. LLM tracing is what makes that kind of reorganization possible, because it is the only instrument that resolves a run into parts you can act on individually.
Below: the four numbers that "latency" hides, what a trace has to record to be diagnostic, a five-zone model for locating slow time, and how to turn the diagnosis into a latency budget that holds.
LLM Latency Is Four Numbers, Not One
LLM latency splits into four measurements that fail independently, and collapsing them into a single average is the most common instrumentation mistake in production AI. Time to first token (TTFT) is the gap between issuing a request and receiving the first piece of the response. Time per output token is how fast the rest then streams. End-to-end duration covers the full operation. Tail latency – p95 and p99 – describes the slow minority of runs that generate every complaint. A median that looks fine says almost nothing about the run a user actually sat through.
The split matters because the two halves of an inference call have opposite drivers. A model processes every input token before it emits the first output token, so TTFT scales with context length: a 50,000-token prompt starts slower than a 500-token prompt on identical hardware. Generation time scales with output length instead. Two calls with the same end-to-end duration can therefore need opposite fixes – one wants a shorter prompt or a warm cache, the other wants a lower max-tokens ceiling or a faster model. Without step-level traces, you cannot tell which one you are holding.
What a Trace Records That a Dashboard Doesn't
A span is a single timed unit of work inside a run – one model call, one tool execution, one retrieval – carrying a start time, a duration, a parent, and a set of attributes. A trace is the tree those spans form. LLM tracing is the practice of emitting spans for every step an AI application takes, so a run’s duration can be decomposed into the durations of its parts instead of reported as one opaque number. It is distributed tracing applied to a non-deterministic call graph: the mechanics are familiar, but the tree changes shape on every run.
The naming is no longer a matter of taste. The OpenTelemetry GenAI semantic conventions – moved to a dedicated repository in June 2026 and still marked Development – define the operations an agent system produces: chat for a model call, execute_tool for a tool invocation, retrieval for a vector lookup, plan for a decomposition step, and invoke_agent for the run as a whole. They also define the latency instruments directly, including gen_ai.client.operation.duration, gen_ai.client.operation.time_to_first_chunk, gen_ai.execute_tool.duration and gen_ai.invoke_agent.duration, plus counters for inference and tool calls per invocation. GenAI usage tokens ride alongside as gen_ai.usage.input_tokens and gen_ai.usage.output_tokens.
Three properties separate an AI agent tracing setup from ordinary APM. Session grouping ties every span produced by one goal into a single record, so you can reconstruct a user-facing wait end to end. Token attributes sit on the spans themselves, which lets you correlate duration against input size rather than guess at it. And the trace backend has to retain the real prompt and response bodies for the runs you care about – "this call took nine seconds" isn't diagnosable without knowing what went into it.
The Agent Latency Ledger: Five Places Time Hides
Every millisecond in an agent run belongs to one of five zones. Naming them turns "it’s slow" into a routing decision.
The fifth zone is the one dashboards never surface. The most expensive latency in an agent trace is often time that belongs to no span at all – the gap between a parent span starting and its first child starting, or between one child ending and the next beginning. That dead air is orchestration: a planner deciding, a framework serializing, a lead agent waiting on the slowest of five sub-agents before it can proceed. Anthropic documents this bottleneck in its own production system, where sub-agents execute synchronously, and the whole system can block while a single one finishes. Sum the child durations and subtract from the parent total; whatever is missing is the gap, and it is frequently the largest line in the ledger.
This decomposition is what an AI agent tracing view is for. OptScale AI’s Team & Agent AI Performance pillar renders any run as a waterfall – every step in the chain, its duration, its model, its token count, and its cost – with sub-second trace lookup across millions of logged interactions, so the ledger can be read off a single run rather than assembled by hand.


