LLM observability
Tracing requests, tokens, latency and cost in AI applications running in production.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
Overview
LLM observability means recording what your AI application actually did for each request: the prompts sent, the retrieved context, every tool call and model response, tokens used, latency and cost. These records, called traces, are how you debug a bad answer or a runaway agent after the fact.
In practice teams instrument their code with an SDK or OpenTelemetry, send traces to a tool such as Langfuse, Phoenix or LangSmith, attach user feedback and automated scores, and turn interesting failures into eval cases. Privacy matters here too: traces contain user data, so decide what to redact and how long to keep it.
What you will practise
- Instrument an app so every request produces a trace
- Track tokens, latency and cost per feature
- Attach user feedback and automated scores to traces
- Turn interesting production failures into eval cases
Learning paths
- Building with the Claude API
Learn to build with the Claude API from your own code: the Messages API, tool use, structured output and prompt caching, then evaluate and trace what you built.
- Evals and safety for LLM features
Learn LLM evals and safety: catch regressions and attacks before users do, with error analysis, code-based evals, calibrated judges and prompt-injection tests.
- LLMOps: observability, evals and cost
Learn LLMOps in practice: trace every request, gate changes with evals in CI, calibrate judges and keep token spend visible and under control in production.
- RAG engineer
A RAG course for engineers who want results they can measure: embeddings, pgvector, a pipeline built in a day, golden datasets, LLM judges and tracing.
Tutorials
- Evaluate AI agents: outcomes, trajectories and tool use
Build an agent eval harness that checks the final state, the tool-call trajectory and a judged transcript, run each task several times and read the traces.
- Cut LLM costs with prompt caching and token budgets
Lay out prompts so the provider can cache them, measure tokens before you send, and use batch processing and model routing to cut what each request costs.
- Trace an agent with OpenTelemetry
Instrument an agent loop with OpenTelemetry GenAI spans, one per model call and tool call, and send the traces to Langfuse or Arize Phoenix.
- LLM-as-a-judge: grading outputs you can trust
Write narrow grading criteria, check the judge's verdicts against your own labels and decide when its agreement is good enough.
Workflow recipes
- Move an app to a new model without regressions
LLM model migration without surprises: freeze a golden set, run old and new models side by side, fix the prompts, compare cost, then roll out behind a flag.
- Add tracing and cost tracking to an LLM app
One trace per user action, with tokens, latency and cost for each model call, so slow and costly features stand out.
Articles
- Agent observability: what to log and why
What to record for AI agents in production: traces and spans, tool calls, cost per task and the signals that catch failures before users report them.
- LLM evals cheat sheet
Check types, a judge prompt template, which metrics to use for RAG, agents, classification and extraction, sample sizes and a CI snippet, on one page.
- Controlling LLM costs without hurting quality
Where LLM spend actually goes (context, retries, agent loops, output) and the levers that cut it without hurting quality: caching, routing, batching, budgets.
- Start your evals by reading outputs, not by picking metrics
The fastest way to useful LLM evals is to read real outputs and write down what is wrong. Why error analysis comes before metrics, and how to do it.
Tools for this skill
9 of 11 tools tagged with this skill.
Arize Phoenix
Source-available tracing and evaluation for LLM applications, built on OpenTelemetry.
Braintrust
Platform for tracing production LLM traffic, running evals and catching regressions.
Helicone
AI gateway and observability layer that logs requests, cost and latency.
Langfuse
Tracing, prompt management and evals for LLM applications.
LangSmith
LangChain's tracing and evaluation platform, usable from any code.
LiteLLM
Open-source SDK and AI gateway that calls 100+ providers through one OpenAI-style API.
MLflow
Open-source ML and GenAI platform with tracing, evaluation and prompt management.
OpenLLMetry
OpenTelemetry instrumentation for LLM providers, vector databases and frameworks.
Opik
Open-source platform from Comet for tracing, evaluating and monitoring LLM apps.
Show 2 more
Key terms
Words you will meet while learning this, defined in the glossary.
- Latency
The time from sending a request to a model to getting the response, often split into time to first token and total generation time.
- LLM observability
Collecting traces, costs, latency and quality signals from AI applications in production so you can debug and improve them.
- Online evaluation
Scoring a sample of real production traffic continuously, with automated checks or judges, to catch problems that offline test sets miss.
- Time to first token
How long a model takes to return the first token of a response after a request, the main driver of how fast a streamed reply feels.