Traces, spans, run logs, cost tracking, and token budgets — understanding what your agent is doing in production.
Key vocabulary
Agent trace — the complete record of one agent run: all steps, tool calls, LLM calls, results.
Span — a single unit of work within a trace (one LLM call, one tool call).
Agent run log — structured log output from an agent run, for debugging.
LLM call cost — the token-based cost of each model API call within the run.
Token budget — a pre-set limit on total tokens the agent run may consume.
0 / 5 completed
1 / 5
An agent trace records:
Agent trace = the full observability record. Captures every LLM call, tool call, tool result, and reasoning step. Essential for debugging, cost analysis, and performance optimisation.
2 / 5
A span in agent observability is:
Span (from OpenTelemetry) = one atomic operation: one LLM API call, one tool execution. Spans have start time, end time, and metadata. Multiple spans compose a trace.
3 / 5
Why do production agent systems track LLM call cost per run?
LLM call cost tracking: agents make many calls per task and costs compound. Tracking enables: identifying expensive tasks, optimising prompts, setting cost budgets, and alerting on anomalies.
4 / 5
A token budget for an agent run is:
Token budget = total token allowance across all calls in one run. When reached, the agent must stop. Prevents runaway agents from consuming unbounded resources.
5 / 5
The agent run log is used to:
Agent run log = structured output designed for engineers to read. Good run logs include: step-by-step reasoning, tool calls with arguments, tool results, and cost-per-step data.