AI Agent Observability: Tools, Metrics and Best Practices
Nov 12, 2026 Artificial Intelligence
Nov 12, 2026 Artificial Intelligence
AI agent observability means capturing an agent’s full decision path, so an engineer can replay any run and see what the agent saw, decided and did at each step. Application performance monitoring (APM) was built for deterministic code, where the same input takes the same path. Agents do not work that way.
An agent can return a fluent answer while having called the wrong tool, retried a failing API six times, or pulled an outdated document. Every HTTP call succeeded, so APM shows green. The failure only appears when you look at the reasoning and actions in between.
That gap is why AI agent monitoring needs three things APM does not give you:
Observability tells you what happened. Evaluation grades whether it was right. Both matter, and this post focuses on the first. For the second, see our guide to AI agent testing and evaluation.

Capture each agent run as one trace, with a span for every model call, tool call, retrieval and handoff, and group traces into sessions for multi-turn conversations. That structure is what lets you answer which step broke.
OpenTelemetry now defines a shared vocabulary for this under the gen_ai.* namespace, including agent operations such as invoke_agent and execute_tool. These GenAI semantic conventions now live in their own repository, so they can be versioned separately from the core OpenTelemetry spec.
One caution from practice: the agent conventions are still marked Development, so attribute names can change between releases. Pin your instrumentation library versions and upgrade on purpose.
Here is a minimal Python example of manual instrumentation for an agent run with one tool call. Most frameworks can do this automatically, but seeing the shape helps when you debug.
from opentelemetry import trace
tracer = trace.get_tracer("support-agent")
def handle_request(user_query: str) -> str:
with tracer.start_as_current_span("invoke_agent support_agent") as agent_span:
agent_span.set_attribute("gen_ai.operation.name", "invoke_agent")
agent_span.set_attribute("gen_ai.agent.name", "support_agent")
with tracer.start_as_current_span("chat") as llm_span:
llm_span.set_attribute("gen_ai.operation.name", "chat")
llm_span.set_attribute("gen_ai.request.model", MODEL_NAME)
plan = call_model(user_query)
llm_span.set_attribute("gen_ai.usage.input_tokens", plan.input_tokens)
llm_span.set_attribute("gen_ai.usage.output_tokens", plan.output_tokens)
with tracer.start_as_current_span("execute_tool lookup_order") as tool_span:
tool_span.set_attribute("gen_ai.operation.name", "execute_tool")
tool_span.set_attribute("gen_ai.tool.name", "lookup_order")
try:
result = lookup_order(plan.order_id)
except Exception as err:
tool_span.record_exception(err)
tool_span.set_status(trace.StatusCode.ERROR)
raise
return compose_answer(result)
In the OpenTelemetry project’s GenAI instrumentation, capturing full prompt and response content is something you switch on, while metadata such as model, token counts and durations is recorded as standard. Turn on full content capture in staging, and in production only with PII redaction in place.

The metrics that matter measure whether the agent finished the job, how it got there and what it cost. Group them into outcome, behavior, performance and cost, and alert on change from your own baseline rather than on fixed industry numbers.
The alert triggers below are starting points we suggest, not benchmarks. Run for two weeks, record your baseline, then tune.
| Metric | What it tells you | Suggested starting alert |
|---|---|---|
| Task success rate | Share of runs that completed the user’s goal, judged by an evaluator or user feedback | Drops 5 points or more below the 7-day baseline |
| Human escalation rate | How often the agent hands off to a person | Rises 50% or more above baseline |
| Steps per task | Reasoning efficiency; a sudden rise often means loops or confusion | p95 doubles, or any run exceeds your hard step cap |
| Tool-call error rate | Failed or invalid tool calls, wrong arguments, timeouts | Above 2% for any single tool over 15 minutes |
| Retries per run | Hidden instability that success rates can mask | Average climbs above 1 per run |
| End-to-end latency (p50, p95) | User experience across the whole run, not one model call | p95 exceeds your product’s latency budget |
| Time to first token | Perceived speed for streaming answers | Above your UX target for 10 minutes |
| Tokens and cost per task | Spend per completed outcome; catches prompt bloat and loops | Rises 30% or more week over week |
| Groundedness or faithfulness score | Whether answers stick to retrieved or tool data | Falls below the threshold set in your eval suite |
Two habits make these numbers useful. First, measure per agent and per tool, not one blended figure, because an average hides the one tool that is failing. Second, link cost to outcomes: cost per successful task tells a CFO far more than total tokens.
Most teams choose between four agent observability tools: LangSmith, Langfuse, Arize Phoenix and Datadog LLM Observability. All of them trace agent runs well. The real differences are hosting, licensing, framework fit and how they bill.
| Tool | Hosting and license | Best fit | Watch out for |
|---|---|---|---|
| LangSmith | Managed cloud, with BYOC and self-hosted options for enterprise; proprietary | Teams on LangChain or LangGraph that want tracing and evals in one place; it also works with other frameworks and OpenTelemetry | Self-hosting needs an enterprise agreement; paid plans scale with trace volume |
| Langfuse | Cloud or self-hosted; core is MIT-licensed | Teams that need data to stay in their own cloud, or want an open-source default | You run and scale the self-hosted stack yourself; enterprise admin features are paid |
| Arize Phoenix | Self-hosted or local; Elastic License 2.0, with Arize AX as the enterprise platform | Local debugging and evaluation, built on OpenTelemetry through OpenInference | Elastic License 2.0 is source-available, not a permissive open-source license |
| Datadog LLM Observability | SaaS, part of the Datadog platform | Companies already on Datadog that want agent traces next to APM, infrastructure and user data | Billed on LLM spans ingested, so one agent run can create several billable spans |
Most agent observability problems come from tracing too little, too late or without context. These are the ones we see most often when teams move agents from pilot to production.
Roll out agent observability in four short phases: instrument one agent, baseline it, alert on it, then make review a habit. Copy this list into your sprint board.
We treat observability as part of the build, not a tool added after launch. When our team develops an agent, tracing goes in during the first sprint, using OpenTelemetry so clients are free to choose or change their backend. We agree on what task success means with the business owner before go-live, because that definition drives every alert that follows. After launch, we run a short baseline period, set alerts on change from that baseline, and review failing traces with the client’s team each week.
Xicom has 150+ AI engineers and data scientists, and our ISO/IEC 42001 certification for AI management systems shapes how we handle logging, retention and access to trace data.
If you are planning an agent for production, see our AI agent development services.
Monitoring watches known signals, such as latency, error rates and cost, and alerts when they cross a line. Observability records enough detail about each run, including prompts, tool calls and retrieved data, that you can investigate problems you did not predict. In practice, teams need both: monitoring tells you something is wrong, and observability tells you why.
LLM tracing records a single model call: the prompt, response, tokens and latency. Agent tracing connects many of those calls with the tool executions, retrievals and handoffs between them into one run. An agent can make a dozen model calls for one task, so you need the full chain to see where a decision went wrong.
Good instrumentation adds very little delay because spans are batched and exported in the background, not sent on every step. The bigger risk is cost and storage when you capture full prompts and responses at high volume. Sample verbose content in production and keep full detail for errors and flagged runs.
Langfuse, with an MIT-licensed core, and Arize Phoenix, under Elastic License 2.0, are the most common open choices, and both can be self-hosted. OpenTelemetry provides the vendor-neutral instrumentation layer underneath. Check each license against how you plan to use the tool, especially if you offer it to your own customers.
Log who triggered the run, which agent and prompt versions ran, every tool the agent called with its arguments and result, and any human approval. Redact personal data before storage, set retention limits and restrict who can read traces. These records help you answer audit questions about why an agent took an action.
Before the first real user. Tracing added during the pilot gives you a baseline to compare against when traffic grows, and it shortens debugging from days to minutes. Retrofitting it after an incident is slower and usually happens under pressure.
Based on this article's topic