Agent Observability

Agent observability is the practice of capturing what an AI agent does at runtime, including every LLM call, tool call, and decision, so you can debug failures, measure quality, and control cost. MLflow provides open-source agent observability through MLflow Tracing, a tool-call dashboard, automated quality scoring, and AI issue detection, under the Apache 2.0 license.

Last updated: 2026-11-26

Agents are different from single LLM calls. They plan, call tools, read the results, and loop until they decide they are done. When an agent gives a wrong answer, the cause is usually several steps earlier: a tool returned stale data, a retrieval missed the right document, or a loop ran twice as long as it should. Agent observability makes those steps visible.

In short: instrument your agent once, then use traces to debug a single run, the dashboard to watch tools and cost over time, scorers to track quality, and issue detection to find problems you did not know to look for.

Quick Navigation:

What Is Agent Observability?

Observability means you can understand a system's internal state from the data it emits. For an agent, that data is the trace: a tree of spans that records each LLM call, tool call, and retrieval, along with inputs, outputs, timing, token usage, and errors. Agent observability adds three layers on top of tracing:

  • Analytics over many traces, such as tool success rates, latency percentiles, and cost trends.
  • Quality measurement with LLM judges, code-based scorers, and human feedback, so "it ran" becomes "it answered correctly".
  • Issue detection that surfaces recurring failure patterns across traces instead of waiting for a user to report them.

If you want the model-call view only, see AI observability. For a comparison of products that offer these features, read Top 5 Agent Observability Tools.

What Should You Observe in an AI Agent?

A useful agent observability setup covers six signals. Each one maps to a view in the MLflow UI.

SignalWhat MLflow capturesWhere to see it
TracesEvery LLM call, tool call, and retrieval step as nested spans, with inputs, outputs, latency, and errorsTraces tab, trace detail view
Tool callsCalls, success rate, latency, and error rate for each tool, taken from TOOL spansDashboard > Tool Calls
QualityScores from LLM judges and code-based scorers, plus human feedback, attached to traces as assessmentsDashboard > Quality, Traces table
Cost and usageToken counts and estimated cost per span, per trace, and over timeDashboard > Usage
Sessions and usersMulti-turn conversations grouped by session ID and user IDSessions tab
IssuesRecurring failure patterns found automatically across traces, with evidenceTraces table Issues column; Issues tab (MLflow 3.18+)

How Do You Instrument an AI Agent?

Start with automatic tracing for your framework. MLflow ships one-line autolog integrations for OpenAI, LangChain and LangGraph, LlamaIndex, CrewAI, AutoGen, DSPy, Anthropic, and others. Then mark your own tools and agent entry point with the @mlflow.trace decorator. Setting the span type to TOOL is what makes a function show up in the tool-call dashboard.

python
import mlflow
from openai import OpenAI
mlflow.set_experiment("support-agent")
mlflow.openai.autolog() # traces every OpenAI call
client = OpenAI()
@mlflow.trace(span_type="TOOL")
def lookup_order(order_id: str) -> dict:
return {"order_id": order_id, "status": "shipped"}
@mlflow.trace(span_type="AGENT")
def support_agent(question: str, session_id: str, user_id: str) -> str:
# Group multi-turn conversations and attribute traces to users
mlflow.update_current_trace(session_id=session_id, user=user_id)
order = lookup_order("A-1001")
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": f"Order data: {order}"},
{"role": "user", "content": question},
],
)
return response.choices[0].message.content

Each call to support_agent is now one trace. The agent span contains the tool span and the LLM span, with inputs, outputs, latency, and token usage on each. Passing a session ID lets MLflow group the turns of one conversation, which matters for agents that fail only after several turns. See tracking users and sessions for details. Because MLflow Tracing is built on OpenTelemetry concepts, you can also export and ingest OpenTelemetry traces.

How Do You Monitor Agent Tool Calls?

Tool calls are where agents most often go wrong: the wrong tool, the wrong arguments, a slow API, or an error the model quietly ignores. The Tool Calls tab of the experiment dashboard summarizes every TOOL span across your traces: total calls, average latency, success rate, failed calls, a per-tool performance table, usage and latency over time, and error rate per tool.

MLflow dashboard Tool Calls tab showing total tool calls, average latency, success rate, a tool performance summary table, tool usage over time, and latency comparison charts for demo agent data
The Tool Calls tab in the MLflow dashboard, shown with MLflow's built-in demo data.

When a tool looks slow or error-prone, click through to the traces that called it and read the exact inputs and outputs in the trace detail view. The dashboard also has Usage and Quality tabs for request volume, latency, errors, token usage, cost, and scorer results.

How Do You Monitor Agent Quality in Production?

Speed and error rate do not tell you whether the agent answered correctly. MLflow can run automatic evaluations on a sample of live traces. Register a scorer, choose a sampling rate, and MLflow attaches the scores to each trace as an assessment. Built-in scorers include ToolCallCorrectness and ToolCallEfficiency for agent behavior, plus Safety, Correctness, and Completeness for responses.

python
import mlflow
from mlflow.genai.scorers import ToolCallCorrectness, ScorerSamplingConfig
mlflow.set_experiment("support-agent")
tool_judge = ToolCallCorrectness(model="gateway:/my-llm-endpoint")
registered = tool_judge.register(name="tool_call_correctness")
registered.start(
sampling_config=ScorerSamplingConfig(sample_rate=0.5), # score 50% of traces
)

Use the same scorers offline with mlflow.genai.evaluate() to test changes before you ship them. Learn more on the LLM and agent evaluation page and in the guide to LLM-as-a-judge.

How Do You Find Agent Issues Automatically?

Dashboards answer questions you already have. Issue detection helps with the ones you do not. The Detect Issues button analyzes the traces in an experiment and groups recurring problems into issues, each with a severity, the affected traces, and the evidence that led to it. You can read more in the AI issue discovery documentation.

What Is the Debug and Improve Loop?

Observability is most useful when it feeds a repeatable loop:

  1. Observe. Trace every run and watch the dashboard for changes in tool errors, latency, cost, or quality scores.
  2. Diagnose. Open the failing traces, find the span where the run went wrong, and group failures with issue detection.
  3. Evaluate. Turn failing traces into an evaluation dataset and write a scorer for the failure.
  4. Fix and compare. Change the prompt, tool, or model, re-run the evaluation, and compare versions side by side before deploying.
  5. Monitor. Keep an online scorer running so a regression shows up in the dashboard, not in a support ticket.

What Should an Agent Observability Platform Support?

Whichever product you evaluate, compare it on the same questions:

  • Open source and self-hostable. Can you run it yourself and keep trace data in your own infrastructure?
  • Standards-based. Does it support OpenTelemetry, so traces are not locked into one vendor's SDK?
  • Framework coverage. Does it trace the agent frameworks and model providers you already use with minimal code?
  • Tool-level visibility. Can you see success rate and latency per tool, not only per request?
  • Quality and issues in the same place. Can you score traces, collect feedback, and detect issues without moving data between tools?

MLflow is built to meet each of these as an open-source platform. For a side-by-side comparison with other tools, see Top 5 Agent Observability Tools.

Frequently Asked Questions

Agent observability is the practice of capturing and analyzing what an AI agent does at runtime, including every LLM call, tool call, retrieval step, and decision, so you can debug failures, measure quality, and control cost. It builds on tracing and adds tool-level analytics, quality scoring, and issue detection. MLflow provides all of these in one open-source platform.

Where Can You Learn More?