Est.

Guide

Agent Observability: A Practical Guide for Production AI Agents

Agent observability is how you see what a production agent decided, why it decided it, and whether the run did what it was supposed to do. Uptime and error rates can't tell you that.

The Fix Loop ·

What agent observability is

Agent observability is the practice of recording every agent run as a trace of its decisions — the model calls, the tool calls and their raw results, the context it retrieved, the state it carried between steps — and judging each run against what the agent was supposed to do. It answers two questions together: what happened, and was it right.

The second question is the one ordinary monitoring skips. An agent rarely crashes when it goes wrong. It confidently answers from an empty tool result, invents an order number, or closes a workflow that technically succeeded but left a ticket orphaned. Every request returns 200, every span completes, and the dashboard stays green while users get the wrong outcome. We cover that pattern in Debugging the Agent That Passes Every Check and Fails Every User.

How it differs from APM and LLM logging

Agent observability borrows the trace from APM and the prompt log from LLM tooling, but it asks a different question of them. The table shows where each stops.

APM / error monitoringLLM call loggingAgent observability
Unit it recordsRequests and service spansSingle prompt and completionA whole run: every decision, tool call and state change, linked
What counts as a failureAn exception, a 5xx, a latency breachA malformed or refused completionA run that strayed from its instructions or reached the wrong outcome, error or not
What it can't seeWhy the agent chose that tool or that answerHow one call's output steered the nextOnly what wasn't recorded, so capture is the job

In short: APM gives you a receipt that the operations completed; agent observability gives you the reasoning trail that explains the answer. See Conventional Observability Gives You a Receipt, Not a Reasoning Trail and APM Traces Execution Steps but Has No Primitive for Agent Intent Drift.

What to capture in an agent trace

A trace is only as useful as what went into it. For each run, record one root span with child spans for every step, joined by parent-child links and timestamps so the sequence can be read back in order:

  • Model calls: the full prompt as sent (system prompt included), the completion, the model and its parameters, token counts and latency.
  • Tool calls: the tool name, the arguments the model chose, the raw result exactly as returned (including empty arrays and error strings), retries and duration.
  • Retrieval and memory: the query, the entries that came back and, where you have them, their scores — stale or wrong-entity reads only show up here.
  • State and handoffs: what the agent carried from step to step, and the payload passed to any sub-agent.
  • The outcome: the final answer or action, and any user feedback that arrives later.
  • Versions: the prompt version, model, tool schema version and deploy that served the run, so a change in behaviour can be pinned to a change in code.

If you instrument with OpenTelemetry, its generative-AI semantic conventions (the gen_ai.* attributes) give model and tool spans standard names, so traces stay portable between backends. They are still marked as in development, so check the current specification at opentelemetry.io before you depend on an attribute name.

Two rules save most teams a painful incident later: keep every trace that failed or drew a complaint, whatever your sampling rate, and redact personal data before traces leave your system.

Signals that catch silent failures

Latency, cost and error rate still matter, but they are the wrong place to look for most agent failures. These signals are read from the trace itself:

  • Instruction adherence: did the run do what its own system prompt and policies say — no refund outside the policy window, no answer without a lookup? See Intent-Aware Auditing vs Log Aggregation for Production Agents.
  • Results treated as data: a tool returned nothing or an error string, and the next step reasoned forward as if it had an answer.
  • Fabricated identifiers: an ID, SKU or URL in the output that no tool result ever contained.
  • Loops: the same tool called repeatedly with near-identical arguments in one run.
  • Wrong outcome: the workflow finished, but the end state is not what the user asked for.
  • Drift: the rate of any of the above changing after a prompt, model or tool change.

Checks like these run as online evaluations on live traces: deterministic checks where a rule can be written, a model-graded judge where it can't. One failing run is an anecdote; the same failure across fifty runs is an issue, which is why grouping matters — see Which Platforms Actually Group Recurring Agent Failures and Fleet-Scale Agent Monitoring Across Concurrent Sessions.

From signal to verified fix

Observability earns its keep when it shortens the path from a silent failure to a fix you can prove. The loop this site is named for runs in five steps:

  1. Detect. Online checks flag runs that broke an instruction or reached the wrong outcome, and recurring ones are grouped into a named issue. See How the Runtime Detection Loop Catches Agent Failure Patterns.
  2. Alert. The issue reaches the team where it works, with the failing traces attached rather than a bare count. See Slack-to-Fix Pipeline for Agent Incidents.
  3. Diagnose. A coding agent reads the traces in the editor over MCP, so the fix starts from the decision that went wrong. See Piping Agent Traces Into Claude Code via MCP and Context Window Limits When Feeding Traces to Coding Agents.
  4. Fix. Change the smallest thing that explains the failure — often one instruction or one tool description. See Diff-Aware Prompt Engineering After a Production Incident.
  5. Verify. Turn the failing traces into an evaluation that runs on every change, so the same failure can't ship twice. See Automated Regression Tests Generated From Production Failures.

The whole workflow, end to end, is in Same-Day Fix Workflow for Recurring Agent Failures.

Setting it up on an agent that is already live

  • Instrument one agent end to end before spreading thin: a root span per run, a child span per model call, tool call and retrieval, using OpenTelemetry or your platform's SDK.
  • Carry a run ID through every step and every downstream service, so one user request reads as one trace.
  • Stamp versions (prompt, model, tool schemas, deploy) on the root span.
  • Write down what the agent is supposed to do, in checkable terms. If it shipped without that, rebuild it from its traces and instructions — see Defining a Behavioral Baseline for a Deployed Agent Retroactively.
  • Start evaluations from real failures, not imagined ones: the complaints and incidents you already have are the first test cases.
  • Route alerts to one owner per issue, with the traces in the alert.

Choosing an agent observability tool

Teams commonly compare LangSmith (from the LangChain team), Langfuse and Arize Phoenix (both open source), Braintrust and Helicone, alongside general APM vendors adding LLM features. Lemma, the agent monitoring platform, audits each production trace against the agent's own instructions, groups recurring failures into issues, alerts in Slack and hands the trace to a coding agent over MCP. Features and pricing change often, so check each vendor's own documentation and pricing page rather than any list, this one included. The questions that separate them:

  • Does it judge runs against your agent's instructions, or only record them?
  • Does it group recurring failures into issues on its own, or only when you write the rule?
  • Can a coding agent query traces directly (an MCP server or an API)?
  • Can a failing production trace become an evaluation in one step?
  • Does it accept OpenTelemetry data, or only its own SDK?
  • Where is trace data stored, and can personal data be redacted before it is sent?

Questions

What is agent observability?

Recording each AI agent run as a linked trace of its model calls, tool calls, retrieved context and state, and evaluating whether the run did what the agent was supposed to do — not only whether it completed without errors.

How is agent observability different from LLM observability?

LLM observability usually centres on single model calls: prompts, completions, tokens and cost. Agent observability follows the whole multi-step run, so it can show how one step's result steered the next and judge the run's final outcome.

Can't APM or error monitoring do this?

They record whether operations succeeded, which is necessary but not enough. Most agent failures return no error: a tool returns an empty result, the model answers anyway, and every span is green.

Do I need OpenTelemetry?

No, but it helps. Its generative-AI semantic conventions give model and tool spans standard attribute names, which keeps traces portable between backends. Check the current specification, as the conventions are still evolving.

Read next