Skip to content

Lesson 4 of 11 · 3 min read

Tracing Agents

A trace records an agent run as a tree of spans: the run, each turn, each model call and each tool call, with timings, token counts, cache reads, costs, model and prompt versions, and which part of the system made each decision. Good tracing answers operational questions (where did the latency go, what does a task cost) and debugging questions (why did it do that), and it feeds evaluation: failed production traces become regression cases. Standard conventions such as OpenTelemetry's generative-AI attributes (still evolving in 2026) let traces flow into existing tools, and redaction and sampling keep them safe and affordable.

Premium lessonReviewed By the AIAgentInterviews editorial team
Get full Premium access · $25

All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.

6 months · One payment · No auto-renewal

Practise it as an interviewer asks it

Course lessons that teach this

Related lessons