arrow_backGuides / AI Observability
Updated July 2026 13 min read Advanced

AI Observability
— seeing what the agent does

An AI agent that "just does not work" is a debugging nightmare — non-deterministic input, a chain of LLM and tool calls, and climbing costs. Observability turns the black box transparent: every trace, every prompt, every token and cost. In this guide: the four pillars, tracing and evals, and LangSmith vs Langfuse.

Tracing
What happened
Evals
How good
Cost
How much
Latency
How fast

Why observability is critical for AI systems

In regular software, the same input always returns the same output. In an LLM-based system it does not: the same question can return different answers, an agent may pick a different tool path on each run, and the cost varies from request to request. Without a dedicated monitoring tool, you are "blind" — you do not know why the agent decided what it did, where it got stuck, and how much it cost.

AI Observability is the equivalent of monitoring in the AI world: it records the entire chain of calls to anagent and to an LLM, measures quality with evals, and tracks costs and latency — so you can debug, improve and trust the system in production.

The four pillars

account_tree
Tracing
A full record of every step: the prompt, the response, tool calls, retrieval — a complete tree of what happened in the request.
grading
Evaluation
Measuring the quality of the answers — automatically (LLM-as-judge, tests) or with human rating.
payments
Cost & Tokens
How many tokens and how much money each request, user or feature consumes. Prevents billing surprises.
speed
Latency
Response times for each step — to identify which model or tool is slowing the system down.

Tracing — the heart of the system

A trace is a record of a whole request, broken intospans — each step in the chain. In a typical agent, one trace contains the initial prompt, the LLM decision, a call to a search tool, a retrieval from avector DB, and the final answer — each with its input, output, time and cost.

When something goes wrong, you open the trace and see exactly where: maybe the retrieval returned irrelevant documents, maybe the tool failed, maybe the prompt was confusing. That is the difference between minutes of debugging and hours of guessing.

hub
OpenTelemetry — the emerging standard

In 2026 there is convergence around OpenTelemetry (OTel) as an open standard for LLM tracing. Most tools support it, so you are not locked to a single vendor — the same instrumentation can send data to Langfuse, LangSmith or any other backend.

Evals — how you know it actually works

"Looks good" is not a metric. Evals are systematic tests of output quality, and without them every "improvement" to a prompt is a gamble. Three main approaches:

The real power: evals alongside CI/CD. You run a set of examples (a dataset) on every change to a prompt or model, and see whether quality rose or fell — before it reaches users. And yes — security testing is part of evals.

LangSmith vs Langfuse — what to choose

Tool Model Best for
LangSmithManaged (closed)Those already on LangChain/LangGraph
LangfuseOpen source + cloudSelf-host, framework-agnostic
Arize / PhoenixOpen source + cloudAdvanced evals, ML too
HeliconeLightweight proxyCost tracking & caching, fast

How to start — the first step

Do not wait until it is "tidy". Add tracing right now — it is a handful of lines. With Langfuse it looks like this:

from langfuse.openai import openai  # transparent wrapper

resp = openai.chat.completions.create(
    model="gpt-4o",
    messages=[{"role":"user","content":"Summarize the document"}],
)
# every call is logged automatically: prompt, response, tokens, cost, latency
lightbulb
The recommended order of operations

1. Add tracing on day one — to see what happens. 2. Set up cost tracking with an alert on overruns. 3. Build a dataset of examples and run evals on every change. 4. Connect feedback from real users into that same dataset. Observability is not a one-off project — it is a continuous improvement loop.