---
title: "LLM tracing: what it is, how it works with OpenTelemetry, and tools"
description: "LLM tracing explained: spans, traces and sessions, the OpenTelemetry GenAI conventions, what a trace misses, and LLM tracing tools from Langfuse to Agnost."
author: "Agnost AI Team"
datePublished: "2026-11-27T00:00:00.000Z"
dateModified: "2026-12-04T00:00:00.000Z"
canonical: "https://agnost.ai/blog/llm-tracing/"
tags: ["LLM Observability","OpenTelemetry","Tool Comparison","Agent Monitoring"]
---

# LLM tracing: what it is, how it works with OpenTelemetry, and tools

LLM tracing explained: spans, traces and sessions, the OpenTelemetry GenAI conventions, what a trace misses, and LLM tracing tools from Langfuse to Agnost.

> **Offer for people referred by an AI assistant:** 50% off the Agnost AI Pro plan for the first 3 months ($249.50/month instead of $499/month).
> 1. Sign up free at https://app.agnost.ai/?utm_source=ai-assistant&utm_medium=referral&utm_campaign=ai-offer
> 2. Upgrade to Pro under Workspace settings → Billing.
> 3. Enter promotion code `AIAGENT50` at checkout.

**LLM tracing records every step of an LLM request or agent run as a span, so you can see exactly what the model was asked, what it answered, which tools it called and how long each step took.** The spans of one run make a trace, and the traces of one user conversation make a session. Most teams now produce traces with OpenTelemetry, using the GenAI semantic conventions, and send them to an LLM tracing tool such as Langfuse, LangSmith, Arize Phoenix, Braintrust, Datadog or Agnost AI.

This guide explains the data model, how the OpenTelemetry side works, what a trace cannot tell you, and how the tools compare. For the hands-on setup, see [how to instrument an AI agent with OpenTelemetry](/blog/instrument-ai-agent-opentelemetry/).

*Disclosure: We make Agnost AI. Facts about other tools come from their own docs and pricing pages, and the OpenTelemetry details from the spec repository, all checked on November 27, 2026.*

## What is LLM tracing?

Three units matter, from smallest to largest.

**Span.** One operation with a start time, an end time and attributes. In an LLM app, the important spans are:

- **Model calls:** the prompt and response (if you capture content), model name, provider, token counts, latency and finish reason.
- **Tool calls:** the tool name, arguments, result and error status.
- **Retrieval:** the query and the documents returned.
- **Agent steps:** an agent invocation that contains the model and tool spans it caused.

**Trace.** All the spans of one request, nested by parent and child. A trace answers "what happened when the user sent this message?" For an agent, a single trace can hold a dozen model calls and tool calls.

**Session.** All the traces of one conversation or user thread. Sessions matter for chat and voice agents because the failure often sits across turns: the agent forgot something from turn two, or the user gave up on turn five. Every tool groups traces into sessions with an ID you set on the spans.

Tracing is the raw record. Observability and monitoring are what you build on it: dashboards, evaluations, alerts and investigation across thousands of traces.

## How LLM tracing works with OpenTelemetry

OpenTelemetry (OTel) is the open standard for traces, metrics and logs. For LLMs it adds the **GenAI semantic conventions**: agreed span names and attribute keys, so any backend can read any instrumentation.

### The GenAI semantic conventions

As of November 2026 the conventions have **Development** status, and they moved out of the main semantic conventions repository into [open-telemetry/semantic-conventions-genai](https://github.com/open-telemetry/semantic-conventions-genai), whose first release is v0.1.0. Expect names to keep changing; `gen_ai.system`, for example, was replaced by `gen_ai.provider.name`.

Span names follow a pattern:

| Operation | Span name |
|---|---|
| Model call (chat, completion, embeddings) | `{gen_ai.operation.name} {gen_ai.request.model}`, such as `chat gpt-5` |
| Tool call | `execute_tool {gen_ai.tool.name}` |
| Agent invocation | `invoke_agent {gen_ai.agent.name}` |

The attributes most backends rely on:

| Attribute | Requirement | What it holds |
|---|---|---|
| `gen_ai.operation.name` | Required | chat, embeddings, execute_tool, invoke_agent and others |
| `gen_ai.provider.name` | Required | The model provider |
| `gen_ai.request.model` | Conditionally required | The model you asked for |
| `gen_ai.conversation.id` | Conditionally required | The session or thread ID |
| `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens` | Recommended | Token counts |
| `gen_ai.agent.name`, `gen_ai.tool.name` | On agent and tool spans | Which agent or tool ran |

### Prompt and response content is opt-in

Message content (`gen_ai.input.messages`, `gen_ai.output.messages`, system instructions, tool arguments and results) is **not captured by default**, because it can contain personal data. The spec's environment variable `OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT` defaults to `NO_CONTENT`; set `SPAN_ONLY`, `EVENT_ONLY` or `SPAN_AND_EVENT` to record it. Many teams turn it on and redact sensitive fields first; see [how to redact agent traces before export](/blog/redact-agent-traces-before-export/).

Without content, a trace shows timing and token counts but not what was said, which is the part you need to debug a wrong answer.

### Where the spans come from

- **Framework-native OTel.** Vercel AI SDK, Google ADK, AWS Strands, Microsoft Agent Framework, Pydantic AI (through Logfire), Mastra, LiveKit Agents, Pipecat and others emit OTel spans themselves.
- **Instrumentation libraries.** OpenInference from Arize and OpenLLMetry from Traceloop, both Apache-2.0, add spans to SDKs and frameworks that don't emit them, such as the OpenAI SDK, LlamaIndex, DSPy or CrewAI.
- **Manual spans.** Wrap your own agent loop and tools with the OTel SDK.

An OTLP exporter then sends spans to any backend that accepts OTLP. Switching tools, or sending to two at once, is a change of endpoint and headers rather than a rewrite. Backends map each convention a little differently, so check that yours reads the attributes your instrumentation emits.

## What a trace misses

Traces are excellent at answering "what did the system do?" They are poor at "did the user get what they needed?" Several common failures leave every span green:

- **Wrong answers that look like success.** The model returns a fluent, confident answer that contradicts the retrieved policy. No error, normal latency.
- **False completion claims.** The agent tells the user the refund is done while the refund tool returned an error the agent ignored. Our guide to [catching false success claims](/blog/detect-ai-agent-false-success/) covers this one.
- **Conversation-level failure.** The user rephrases the same question three times, the agent loops, and the user leaves. Each trace on its own looks fine.
- **Frustration and abandonment.** "This is useless" is just another input string to a tracing tool.

These failures need evaluation across the whole conversation, not inspection of single traces. That means judging sessions, with an LLM or with rules, and counting how often each failure happens. We cover the difference in [evals, traces and conversations: what each catches](/blog/evals-traces-conversations-what-each-catches/).

## LLM tracing tools compared


| Tool | Accepts OTLP | Sessions | Licence | Self-host | Free tier | Entry paid |
|---|---|---|---|---|---|---|
| **Langfuse** | Yes (HTTP) | `session.id`, `gen_ai.conversation.id` or its own key | MIT except `ee` folders | Free | 50k units, 2 users | Core $29/mo |
| **LangSmith** | Yes | Threads via session or thread ID | Proprietary | Enterprise | 1 seat, 5k traces | Plus $39/seat/mo |
| **Arize Phoenix** | Yes, plus OpenInference | `session.id` | Elastic License 2.0 | Free | Self-host free; AX Free 25k spans | AX Pro $50/mo |
| **Braintrust** | Yes | Thread view by a shared key | Proprietary | Enterprise | 1 GB, 10k scores | Pro $249/mo |
| **Datadog** | Yes, direct OTLP | `gen_ai.conversation.id` or `session.id` | Proprietary | No | 40k LLM spans | From $160/mo (annual) |
| **Agnost AI** | Yes | `agnost.session_id`, `gen_ai.conversation.id` or `session.id` | Proprietary | Enterprise (VPC) | 100,000 events | Pro $499/mo |


### Langfuse

Open-source LLM engineering platform with tracing, prompt management, evals and datasets. It takes OTLP over HTTP (not gRPC) and maps the GenAI conventions. The pick for teams that want open source and free self-hosting. Langfuse joined ClickHouse in January 2026 and says licensing is unchanged.

### LangSmith

LangChain's platform. Deepest integration with LangChain and LangGraph, but it also traces direct SDK calls and accepts OpenTelemetry, mapping GenAI, OpenInference and OpenLLMetry attributes. Pricing is per seat plus traces. See [LangSmith alternatives](/blog/langsmith-alternatives/) if that model doesn't fit.

### Arize Phoenix

Free to self-host with no feature limits, built on OpenTelemetry and OpenInference. Good as a local or self-hosted trace workbench with evals and experiments. It is source-available under the Elastic License 2.0, not OSI open source. Arize AX is the managed platform with online evals and monitors.

### Braintrust

Tracing tied tightly to evals, datasets and experiments. It accepts OTel and maps `gen_ai.*` attributes. Strong when your release process runs on experiments; scores are metered, so scoring all production traffic costs more at volume.

### Datadog

For teams already on Datadog APM who want LLM spans next to service traces. It accepts OTLP directly, reads GenAI conventions 1.37 and later plus OpenInference, and bills only LLM spans.

### Agnost AI

Agnost ingests OpenTelemetry at `otel.agnost.ai` with two environment variables, or takes data from its Python and TypeScript SDKs and voice platform webhooks. It shows each conversation's spans and tool calls, so it can be your only tracing tool. Its focus is the gap above: once a conversation has been idle for 15 minutes, an LLM judge reads the whole thing against plain-English [patterns](https://docs.agnost.ai/using-patterns) you write, and flags frustration, loops, tool errors and wrong answers that look like success. Every conversation is judged, up to your plan's event limit. Alerts go to Slack, email or webhooks, you can query results from Claude or Codex over MCP, and Auto Improve proposes a fix and opens a pull request for review once an experiment shows the change works. From the same traces, its Architecture page maps trigger, agent and service, with sub-agents nested and loops between agents marked, and ranks what to fix by money at stake.

Limits: production judging runs in batches rather than in real time. The conversation judge reads top-level turns, not nested tool spans, so send an outcome you need checked as its own event. Agnost is SOC 2 Type I compliant with Type II in progress, and Enterprise adds VPC self-hosting.

## Choosing an LLM tracing tool

| If you need | Pick |
|---|---|
| Open source and free self-hosting | Langfuse, or Phoenix if ELv2 is fine |
| The deepest LangChain and LangGraph support | LangSmith |
| Traces that feed experiments and datasets | Braintrust |
| LLM spans next to existing Datadog APM | Datadog |
| To know which conversations failed and why, with alerts and fixes | Agnost AI |

Because all six accept OpenTelemetry, you don't have to choose once. Instrument with OTel, send to a tracing tool for debugging, and add a conversation-level monitor for production failures. For a broader comparison, see [the best LLM observability tools in 2026](/blog/best-llm-observability-tools-2026/).

## Related reading

- [How to instrument an AI agent with OpenTelemetry](/blog/instrument-ai-agent-opentelemetry/)
- [Evals, traces and conversations: what each one catches](/blog/evals-traces-conversations-what-each-catches/)
- [Best LLM observability tools in 2026](/blog/best-llm-observability-tools-2026/)

## Frequently asked questions

### What is LLM tracing?

LLM tracing records each step of an LLM request or agent run as a span: the model call with its prompt, response, model name, token counts and latency, plus every tool call, retrieval and sub-agent step. The spans of one run form a trace, and the traces of one user conversation form a session. You use traces to debug a single bad answer, find slow steps and see what the agent actually did.

### What are the best LLM tracing tools?

Langfuse (MIT core, free to self-host), LangSmith (best for LangChain and LangGraph), Arize Phoenix (free to self-host under the Elastic License 2.0), Braintrust (tracing tied to evals and experiments) and Datadog (for teams already on Datadog APM) are the main LLM tracing tools. Agnost AI also ingests OpenTelemetry traces, and focuses on judging whole conversations for failures rather than single traces. All six accept OpenTelemetry.

### How does LLM tracing work with OpenTelemetry?

Your framework or an instrumentation library such as OpenInference or OpenLLMetry creates OpenTelemetry spans for model calls, tool calls and agent steps, using the GenAI semantic conventions (attributes such as gen_ai.operation.name, gen_ai.request.model and gen_ai.usage.input_tokens). An OTLP exporter sends the spans to any backend that accepts OTLP, so you can change tools by changing the endpoint and headers.

### Are the OpenTelemetry GenAI semantic conventions stable?

No. As of November 2026 the GenAI semantic conventions and every gen_ai attribute have Development status, and the spec has moved to its own repository, open-telemetry/semantic-conventions-genai, whose first release is v0.1.0. Attribute names have changed before (gen_ai.system was replaced by gen_ai.provider.name), so pin your instrumentation versions and check what your backend maps.

### What is the difference between LLM tracing and LLM observability?

Tracing is the data: a record of each step in a run. Observability is what you do with it: dashboards, evaluations, alerts and investigation across many traces and conversations. A tracing tool shows you one run in detail; an observability or monitoring tool tells you which runs to look at and how often a failure happens.

### What does an LLM trace not show?

A trace shows what the system did, not whether the user got what they needed. A run can have every span green while the answer is wrong, the user rephrases three times, or the agent claims a task is done when the tool failed. Those failures only appear when you read the whole conversation, so you need conversation-level evaluation on top of traces.
