best LLM tracing tools
Summary
- The best LLM tracing tools record each step of a request (model calls, retrieval, tool calls) as nested spans with inputs, outputs, latency and token usage, so you can see why an answer came out the way it did.
- Prioritize OpenTelemetry compatibility, one-line automatic instrumentation for the frameworks you use, a manual API for custom code, and production features such as asynchronous logging and sampling.
- MLflow Tracing is an open-source, Apache-2.0 option that is fully OpenTelemetry-compatible, autologs frameworks such as LangChain, LangGraph and DSPy, and keeps trace data on infrastructure you control.
- Traces matter most when they flow straight into evaluation and feedback, since the trace is the record you score, label and turn into test cases.
- On Databricks, MLflow traces can be stored as OpenTelemetry-format Delta tables in Unity Catalog, governed by catalog permissions and queryable with SQL.
best LLM tracing tools
The best LLM tracing tools capture every step of a request as a tree of spans: the prompt sent to the model, the documents a retriever returned, each tool call and the final answer, with latency and token usage on each step. Pick one that speaks OpenTelemetry, instruments your framework with a single call, and lets you query and keep the traces yourself. For teams building on open source, MLflow Tracing is a sensible default. It's Apache-2.0 licensed, fully OpenTelemetry-compatible, and the same traces feed evaluation and human feedback.
What is LLM tracing?
LLM tracing records the execution path of a generative AI application or agent. In MLflow's words, a trace captures "the inputs, outputs, and metadata associated with each intermediate step of a request."
| Concept | What it is | Why it matters |
|---|---|---|
| Trace | One end-to-end request, from user input to final response | The unit you debug, score and label |
| Span | One step inside the trace, such as an LLM call, a retrieval or a tool call | Shows where time, tokens and errors come from |
| Span type | A label such as LLM or CHAIN (MLflow's SpanType) |
Lets the UI and queries treat model calls apart from glue code |
| Session and user | IDs that group traces into one conversation | Needed to debug multi-turn chat and agents |
Key capabilities to evaluate
| Criterion | What to look for |
|---|---|
| Automatic instrumentation | One-line autologging for the agent frameworks and model SDKs you already use |
| Manual instrumentation | A decorator and a context manager for custom functions, so no step stays a black box |
| Open standards | OpenTelemetry compatibility, including the GenAI semantic conventions, so traces can move between backends |
| Token and cost data | Input, output and total tokens per LLM call, rolled up per trace |
| Production readiness | Asynchronous logging, trace sampling and a lightweight SDK for deployed services |
| Search and query | Filters on status, latency, tags or session, plus programmatic access for analysis |
| Storage and governance | Control over where traces live, who can read them and how long they're kept |
| Path to quality | Traces that judges can score, people can annotate and you can add to evaluation datasets |
The options fall into a few groups: open-source tracing SDKs and servers you can self-host (MLflow is one), framework-native tracers tied to a single agent framework, application performance monitoring suites with GenAI views added, and gateway logs. Gateway logs see every model call but not the retrieval or tool steps inside your code, so many teams pair them with an open tracer.
Tracing an app with MLflow
Open-source MLflow Tracing supports both styles of instrumentation. For supported libraries, autologging "captures a trace with a span for each step," and LangGraph uses LangChain's autolog call. For your own code, the @mlflow.trace decorator and the mlflow.start_span context manager create spans by hand.
import mlflow
from mlflow.entities import SpanType
mlflow.langchain.autolog() # LangChain and LangGraph steps become spans
@mlflow.trace(span_type=SpanType.CHAIN)
def answer(question: str) -> str:
with mlflow.start_span(name="rerank") as span:
span.set_inputs({"question": question})
docs = rerank(retrieve(question)) # your own functions
span.set_outputs({"doc_count": len(docs)})
return generate(question, docs)
For deployed services, MLflow recommends the smaller mlflow-tracing package, asynchronous logging and trace sampling through MLFLOW_TRACE_SAMPLING_RATIO. Traces can also go to any OpenTelemetry-compatible backend, or to MLflow and a collector at once through dual export.
How Databricks approaches LLM tracing
MLflow on Databricks is the same open-source MLflow, managed and integrated with the platform, so instrumented code keeps working once the tracking URI points at databricks. The platform adds governed storage and access:
- Traces as governed tables. Databricks can store traces as OpenTelemetry-format Delta tables in Unity Catalog, with spans, logs, metrics and annotations in separate tables. Access follows catalog, schema and table permissions, and there's no per-experiment limit. This needs MLflow 3.14 or later and a SQL warehouse.
- SQL on traces. As Delta tables, traces can be queried from a SQL warehouse, charted in AI/BI Dashboards or wired to alerts.
- Traces from anywhere. Third-party OpenTelemetry clients can send OTLP traces to the workspace endpoint
/api/2.0/otel/v1/traces, and agents that run outside Databricks can write traces to Unity Catalog too. - One record for debugging and quality. MLflow judges score the same traces reviewers annotate, and Genie Code answers natural-language questions about traces and evaluation runs.
On serverless compute, call mlflow.<library>.autolog() explicitly, because GenAI autologging isn't enabled automatically there. See the tracing overview and Unity Catalog trace storage docs.
FAQs
Is MLflow Tracing free and open source?
Yes. MLflow is open source under the Apache-2.0 license, and self-hosted trace data stays on your own infrastructure.
Does MLflow Tracing work with OpenTelemetry?
Yes. MLflow describes its tracing as fully OpenTelemetry-compatible, with native support for the GenAI semantic conventions, and an MLflow server accepts OTLP traces.
Do I have to rewrite my app to add tracing?
Usually not. One mlflow.<library>.autolog() call covers supported frameworks; add @mlflow.trace only where autologging doesn't reach.
Will tracing slow my application down?
MLflow's docs say that with asynchronous logging, traces are logged in the background and don't affect application performance. Async logging is the default in OSS MLflow and in Databricks jobs and Model Serving, but you have to enable it in Databricks notebooks.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.