Agents, Tool Use & MCP·Question 50 of 90Advanced

What does good observability look like for an agent system?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Full-fidelity traces at the unit of a run, with metrics aggregated above them - you cannot debug an agent from request logs, because the failure is usually a decision, not an exception.

Full worked answer

Full-fidelity traces at the unit of a run, with metrics aggregated above them - you cannot debug an agent from request logs, because the failure is usually a decision, not an exception.

Trace structure. Model each run as a trace; each loop iteration, LLM call, and tool execution as spans (OpenTelemetry GenAI semantic conventions are the emerging standard; LangSmith, Langfuse, Braintrust, and Arize Phoenix all implement this shape). Capture per LLM span: exact rendered prompt, completion, model ID and params, token counts, latency, cache hit/miss, finish reason. Per tool span: name, arguments, full result (or a pointer to it), duration, error class. Per run: outcome, iterations, total tokens/cost, stop reason (natural finish vs budget vs abort). Subagent runs nest as child traces so you can follow a delegation chain.

Replay is the killer feature. Persist enough to re-render any LLM call exactly as it was sent - that's how you answer "why did it pick the wrong tool at step 12?" and how you turn production failures into eval cases with one click. This trace→eval pipeline is the most valuable loop in agent ops: your eval set should be substantially harvested from real failed runs.

Metrics that matter: task success rate (where measurable), steps per task and its distribution (a fattening tail = emerging loop behaviour), token/cost per run, tool error rate per tool (a spiking tool = broken integration or degraded descriptions), loop-abort and budget-exhaustion rates, human-gate rejection rate (approvals being denied = agent proposing bad actions), and latency broken down model-vs-tool. Alert on distribution shifts, not just failures - agents degrade by getting slower and more wasteful before they start visibly failing.

The unglamorous essentials: sampled human transcript review on a schedule (metrics miss qualitative rot); PII handling in traces (prompts contain user data - redact, scope retention, control access, since traces are themselves a sensitive-data store); and version-stamping every trace with prompt/tool-definition/model versions so regressions bisect cleanly.

What a good answer covers

  • Full-fidelity traces at the unit of a run, with metrics aggregated above them - you cannot debug an…
  • Model each run as a trace; each loop iteration, LLM call, and tool execution as spans (OpenTelemetry…
  • Capture per LLM span: exact rendered prompt, completion, model ID and params, token counts, latency,…
  • Per tool span: name, arguments, full result (or a pointer to it), duration, error class
  • Per run: outcome, iterations, total tokens/cost, stop reason (natural finish vs budget vs abort)

Key terms: Trace structure · Replay is the killer feature · Metrics that matter · The unglamorous essentials

Interviewer follow-ups to expect

  1. How do you detect "silent degradation" - success rate stable but quality dropping?

  2. What would you redact from traces without destroying debuggability?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep