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:
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:
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.
A useful agent observability setup covers six signals. Each one maps to a view in the MLflow UI.
| Signal | What MLflow captures | Where to see it |
|---|---|---|
| Traces | Every LLM call, tool call, and retrieval step as nested spans, with inputs, outputs, latency, and errors | Traces tab, trace detail view |
| Tool calls | Calls, success rate, latency, and error rate for each tool, taken from TOOL spans | Dashboard > Tool Calls |
| Quality | Scores from LLM judges and code-based scorers, plus human feedback, attached to traces as assessments | Dashboard > Quality, Traces table |
| Cost and usage | Token counts and estimated cost per span, per trace, and over time | Dashboard > Usage |
| Sessions and users | Multi-turn conversations grouped by session ID and user ID | Sessions tab |
| Issues | Recurring failure patterns found automatically across traces, with evidence | Traces table Issues column; Issues tab (MLflow 3.18+) |
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.
import mlflowfrom openai import OpenAImlflow.set_experiment("support-agent")mlflow.openai.autolog() # traces every OpenAI callclient = 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 usersmlflow.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.
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.
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.
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.
import mlflowfrom mlflow.genai.scorers import ToolCallCorrectness, ScorerSamplingConfigmlflow.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.
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.
Observability is most useful when it feeds a repeatable loop:
Whichever product you evaluate, compare it on the same questions:
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.