Dev tools

LLM Observability: What to Track and Which Tools to Use

LLM observability explained: traces, spans, cost, latency and quality signals, how it differs from evaluation, the main tools, and how to set it up.

By OmniAI Editorial · Nov 20, 2026 · 12 min read

LLM observability is the practice of recording and analysing what happens inside an application that uses large language models, so you can see why it gave a particular answer, how long it took, what it cost and whether quality is slipping. In practice it means tracing every request (the prompt, retrieved documents, tool calls, model responses and their timings), tracking token usage and cost, and attaching quality signals such as evaluation scores and user feedback. Classic monitoring tells you a service is up; LLM observability tells you whether the answers are any good and where they went wrong.

This guide covers what to track, how LLM tracing works, how observability relates to evaluation, the main LLM observability tools (including Langfuse vs LangSmith), cost tracking, privacy and a practical setup checklist.

Why LLM Apps Need Their Own Observability

Traditional application monitoring tracks errors, latency and resource use. LLM applications add problems that those metrics miss:

  • Wrong answers return HTTP 200. A hallucinated or off-topic answer looks like a success to normal monitoring.
  • Behaviour is non-deterministic. The same input can produce different outputs, so you need the actual prompt and response to debug.
  • Many steps per request. A RAG app or agent may call retrieval, a reranker, several tools and several models for one user question.
  • Cost scales with tokens, not requests, and one runaway agent loop can cost more than a day of normal traffic.
  • Quality drifts when you change a prompt, switch models, a provider updates a model, or users start asking new kinds of questions.

What to Track

SignalExamplesWhy it matters
TracesFull request path: retrieval, tool calls, model callsDebug a specific bad answer
Inputs and outputsPrompt, system prompt version, responseSee exactly what the model saw and said
LatencyTotal time, time to first token, per-step timeFind slow steps; streaming UX
Tokens and costInput, output and cached tokens per call; cost per user and featureBudget, pricing and abuse detection
ErrorsTimeouts, rate limits, refusals, invalid tool calls, parsing failuresReliability
Quality scoresAutomated evals, LLM-as-judge scores, groundedness checksCatch bad answers at scale
User feedbackThumbs up/down, edits, retries, abandoned sessionsReal-world quality signal
MetadataUser or tenant, feature, model, prompt version, environmentSlice everything above

How LLM Tracing Works

LLM tracing borrows the concepts of distributed tracing:

  • A trace is one end-to-end request, such as a user's question and the final answer.
  • A span is one step inside it: a retrieval query, an embedding call, a model call, a tool call, a guardrail check. Spans nest, so an agent's trace shows each loop iteration and the tools it used.
  • Each span records inputs, outputs, timings, token counts, model name and parameters, plus any errors.
  • Traces are grouped into sessions for multi-turn conversations.

Looking at a trace, you can see that a bad answer came from the retriever returning the wrong document, or from a tool returning an error the model ignored, or from the model itself. Without traces, you only see the final answer.

OpenTelemetry is becoming the common format. Its generative AI semantic conventions define standard attribute names such as gen_ai.request.model and gen_ai.usage.input_tokens, so instrumented code can send traces to different backends. The conventions are still evolving, and tools differ in how fully they follow them, but choosing OpenTelemetry-compatible instrumentation reduces lock-in.

Six light panels in two rows, each with an ink line chart; the line in the top middle panel is orange.
Dashboards show latency, cost, errors and quality over time, so you can spot when something changes.

LLM Observability vs LLM Evaluation

They overlap but answer different questions:

  • Evaluation tests quality on a defined set of examples, usually before a release: "Does the new prompt answer our 200 test questions better?" Our guide to LLM evaluation covers how to build those tests.
  • Observability watches real traffic after release: "What are users actually asking, what did the model do, and is it getting worse?"

The best setups connect them in a loop. Observability finds failing real-world cases; you add them to the evaluation set; evaluation checks the fix; observability confirms it worked in production. Many tools also run online evaluations: automated scorers applied to a sample of live traces, such as checks for groundedness, relevance, toxicity or format.

LLM Cost Tracking

LLM cost tracking deserves its own attention, because token costs are easy to underestimate:

  • Record tokens per call, including cached and uncached input separately, since cached input is much cheaper on most providers.
  • Attribute cost to users, tenants, features and prompt versions, so you know which feature or customer drives the bill.
  • Watch for outliers: agents stuck in loops, unexpectedly long contexts, or users sending huge documents.
  • Set budgets and alerts per project or tenant.
  • Compare models on cost per successful task, not cost per token; a cheaper model that needs retries can cost more.

An LLM gateway can record usage and enforce limits centrally if you call several providers.

Three rounded boxes placed around an ink circle with arrows showing a clockwise loop; two boxes are grey and the box on the right is orange.
Observability finds failures in real traffic, evaluation tests the fix, and observability confirms it in production.

LLM Observability Tools

ToolTypeNotable for
LangfuseOpen source (MIT), self-host or cloudTracing, prompt management, evals, cost tracking; framework-agnostic
LangSmithCommercial (from LangChain), cloud or self-host on enterprise plansDeep LangChain and LangGraph integration; also works without them
Arize PhoenixOpen source (Elastic License 2.0)OpenTelemetry-native tracing and evaluations
HeliconeOpen source, proxy-basedLogging and cost tracking by changing the API base URL
BraintrustCommercialEvaluation-first platform with production logging
Weights & Biases WeaveCommercialTracing and evals for teams already using W&B
Datadog LLM ObservabilityCommercial, part of DatadogLLM traces next to existing infrastructure monitoring
OpenLLMetry and OpenInferenceOpen source instrumentationOpenTelemetry instrumentation libraries that send traces to many backends

Langfuse vs LangSmith

Langfuse vs LangSmith is a common choice:

  • Langfuse is open source under the MIT licence and can be self-hosted for free, which suits teams with strict data rules. It works with any framework through SDKs and OpenTelemetry, and includes prompt management and evaluations.
  • LangSmith comes from the LangChain team and integrates most tightly with LangChain and LangGraph, though it also works without them. It's a commercial product with a free tier; self-hosting is part of its enterprise offering.

If you use LangGraph heavily, LangSmith is the path of least resistance. If you want open source, self-hosting or framework independence, Langfuse is the usual pick. Phoenix is a good alternative if you want OpenTelemetry-native tracing.

OpenTelemetry for LLMs

OpenTelemetry is becoming the common language for LLM traces, so you can switch tools without re-instrumenting your app. Its GenAI semantic conventions now live in their own repository (open-telemetry/semantic-conventions-genai). They define standard names for model calls, agents, tool executions, embeddings, retrieval, MCP and provider-specific details for OpenAI, Anthropic, AWS Bedrock and Azure AI Inference.

A few standard attributes show the idea:

AttributeWhat it records
gen_ai.operation.nameThe kind of operation, such as chat, invoke_agent or execute_tool
gen_ai.request.modelThe model you asked for
gen_ai.usage.input_tokens / gen_ai.usage.output_tokensToken counts for cost tracking
gen_ai.agent.nameWhich agent ran the step
gen_ai.tool.nameWhich tool the agent called
gen_ai.conversation.idLinks all spans in one conversation

Most of these conventions are still marked as in development, so names can change between versions. In practice, use an instrumentation library (OpenLLMetry, OpenInference or your vendor's SDK) rather than writing attributes by hand, and check that your backend understands the version it emits.

Agent Observability

Agents make observability harder because one user request can trigger dozens of model calls and tool calls, sometimes in loops. A trace for an agent is a tree: the top span is the task, with child spans for each reasoning step, tool call, retrieval and sub-agent.

Track these agent-specific signals on top of the basics:

  • Task success rate: did the agent finish the job the user asked for? Score it with user feedback or an evaluator.
  • Steps per task: a rising number often means the agent is confused or looping.
  • Tool call errors: failed API calls, bad arguments and timeouts, per tool.
  • Loops and retries: the same tool called with the same arguments several times in a row.
  • Cost and time per completed task, not just per model call.
  • Handoffs: which agent passed work to which, in multi-agent systems.

When an agent fails, the trace should let you replay its reasoning step by step and see exactly which tool result or prompt led it off course.

What to Alert On

Dashboards are for investigating; alerts are for problems you must act on now. Good starting alerts for an LLM app:

SignalWhy it mattersStarting rule (tune to your app)
Error rate from the model APIOutages, rate limits, bad requestsAlert when it rises well above its normal level for several minutes
p95 latencyUsers leave slow chatsAlert when p95 stays above your target for a sustained period
Cost per hour or per featureRunaway loops and prompt bugs burn money fastAlert on a sudden jump against the same hour last week
Negative feedback rateQuality drops after a prompt or model changeAlert when it rises after a deployment
Guardrail triggersPossible prompt injection or abuseAlert on spikes, especially from one user or tenant
Agent steps per taskLooping agentsAlert when the average or maximum jumps

Tie every alert to a trace link, so the person on call can open a failing example straight away.

How to Choose an LLM Observability Tool

Use these questions to narrow the list:

  1. Self-hosted or cloud? If prompts can't leave your infrastructure, start with open-source tools you can host, such as Langfuse or Phoenix.
  2. Which framework do you use? LangGraph teams get the smoothest experience with LangSmith; framework-agnostic teams should favor OpenTelemetry-based tools.
  3. Do you need evaluations built in? Some tools focus on tracing; others combine tracing with datasets, experiments and LLM-as-judge scoring.
  4. Proxy or SDK? A proxy such as Helicone takes minutes to set up but only sees model calls. SDK or OpenTelemetry instrumentation sees the whole request, including retrieval and tools.
  5. Do you already run an APM? If your team lives in Datadog or New Relic, their LLM features keep model traces next to the rest of your monitoring.
  6. How is it priced? Most tools charge by traces, spans or events. Estimate your monthly volume and check what sampling options exist.

Start with one tool on one feature, run it for two weeks, and check whether it helped you find and fix a real problem before rolling it out everywhere.

How to Set Up LLM Observability

  1. Instrument every model call with an SDK, OpenTelemetry instrumentation, or a proxy. Capture model, parameters, prompt, response, tokens, latency and errors.
  2. Trace the whole request, not just the model call: retrieval, reranking, tool calls and guardrails.
  3. Tag everything with user or tenant ID, feature, prompt version, model and environment.
  4. Capture user feedback in the UI and link it to the trace.
  5. Add automated scores on a sample of traffic: format checks, groundedness against retrieved documents, and safety checks.
  6. Build dashboards and alerts for latency, error rate, cost per feature and quality scores.
  7. Review traces weekly, especially those with negative feedback, and turn recurring failures into evaluation cases.

Privacy and Data Handling

Traces contain whatever users type and whatever your app retrieves, which can include personal or confidential data:

  • Redact or mask personal data such as emails, phone numbers and account numbers before storing traces.
  • Set retention limits and delete traces you don't need.
  • Control access to the observability tool like any production database.
  • Consider self-hosting if data can't leave your infrastructure.
  • Sample high-volume, low-risk traffic instead of storing everything.

These controls sit alongside your AI guardrails, which block harmful inputs and outputs in real time.

Common Mistakes

  • Logging only the final answer, so you can't tell which step failed.
  • No prompt versioning, so you can't connect a quality drop to a prompt change.
  • Tracking cost per request instead of per user or feature.
  • Relying only on thumbs-down feedback, which few users give.
  • Storing sensitive data in traces without redaction or retention rules.
  • Building dashboards nobody reviews. Pick a few metrics and look at them.

FAQ

What is LLM observability?

LLM observability is recording and analysing the internal steps, inputs, outputs, costs and quality of an application that uses large language models, so teams can debug bad answers, control cost and catch quality problems in production.

What is the difference between LLM monitoring and observability?

Monitoring tracks known metrics such as latency, errors and cost, and alerts when they cross thresholds. Observability adds detailed traces of each request, so you can investigate why something happened, including problems you didn't anticipate.

What is LLM tracing?

LLM tracing records each step of a request, such as retrieval, model calls and tool calls, as nested spans with their inputs, outputs, timings and token counts. It shows exactly how an application produced a particular answer.

What are the best LLM observability tools?

Popular options include Langfuse and Arize Phoenix (open source), LangSmith, Braintrust, Helicone, Weights & Biases Weave and Datadog LLM Observability. The best choice depends on your framework, whether you need self-hosting, and whether you already use a monitoring platform.

Is Langfuse better than LangSmith?

Neither is better for everyone. Langfuse is open source and free to self-host, and works with any framework. LangSmith integrates most closely with LangChain and LangGraph and is a commercial product. Teams that need self-hosting or open source often choose Langfuse.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog