LLM observability: what to capture and why it matters
LLM observability is the practice of recording every exchange between your application and a model, what went in, what came back, how long it took, what it cost, and whether the reply actually helped, so you can find and fix failures that standard monitoring misses.
By Arun Prasad · Published · Last updated
On this page
Why LLM observability matters
Your agent can return a 200 on every call and still give the user the wrong answer, an invented fact, or a response that completely ignores what they asked. Standard uptime monitoring shows the request went through. It has nothing to say about whether the answer was right.
When a REST API returns 500, something broke. When an LLM returns 200, the conversation might still have gone completely wrong. The model may have hallucinated a fact, ignored the user's actual question, contradicted something it said two turns earlier, or given advice that exposes your company to regulatory risk. None of that shows up in your error rate or your p99 latency.
This is the core problem LLM observability solves: it moves the measurement from "did the request complete" to "did the answer help." Infrastructure can be fully healthy while the model is consistently unhelpful or inaccurate.
Without observability, failures accumulate silently. Users get bad answers, lose confidence, and stop using the product. By the time it shows up in support tickets or churn, the problem has been running for days or weeks. With observability, you see the failure on the trace that produced it.
Step 1: Understand what makes LLM observability different from traditional monitoring
Traditional application performance monitoring (APM) measures whether a request completed, how long it took, and whether it threw an error. That is enough for a database query or an API call with a well-defined contract. It is not enough for an LLM.
An LLM response has no contract. The same prompt can produce different outputs on successive calls. A response can be grammatically correct, semantically coherent, and factually wrong. A multi-turn conversation can degrade gradually, the model losing track of earlier context, changing its position, or accumulating small errors, without any single exchange failing at the HTTP layer.
The practical difference is what you instrument and what you score:
- APM: request duration, status code, error rate, throughput.
- LLM observability: all of the above, plus the prompt, the reply, the intent, whether the reply answered the question, whether it contradicted your knowledge base, and whether the user's goal was met by the end of the conversation.
Tracking the outcome against the user's goal, not just span status, is what distinguishes LLM observability from putting logs in a dashboard.
Step 2: Decide what to track
Start with the data that tells you whether each exchange went well. That falls into four categories.
Latency and cost. Record how long the model took to respond (latency_ms) and, where your provider gives it, the token counts for input and output (token_count_input, token_count_output). These let you see which agents, workflows, and user intents cost the most and take the longest. Without them, cost and performance problems are invisible until they hit your bill.
Identity fields. Record which model handled the request (model) and, if you run more than one agent, which agent it was (agent_id, agent_name). A model inventory built from these fields shows trace volume, average latency, and last activity per model, with nothing to register by hand.
Conversation context. If your application has multi-turn conversations, include a session_id on every trace that belongs to the same session. Traces that share a session_id are grouped into one conversation, so you can read the whole exchange in order and see where drift or failure started. You cannot add a session_id to old traces after the fact, so set this up from the start.
Quality signals. Latency and cost tell you how the model performed. Quality signals tell you whether it was useful. The specific fields you need in a trace record are:
| Field | Type | Why it matters |
|---|---|---|
| input_messages | Array of {role, content} objects | The conversation history the model received |
| output_message | String | The model's reply |
| latency_ms | Integer | How long the model took (use 0 if not measured) |
| model | String | Which model produced this reply |
| token_count_input / token_count_output | Integer | Token usage for cost tracking |
| session_id | String | Groups traces into one conversation |
Guardrail events, when a rule flagged or blocked something, are recorded automatically against the trace that triggered them, so you don't need to send them separately.
Step 3: Choose how to instrument your application
There are four ways to send data to an LLM observability platform. You need one.
Python SDK, the right choice for complex agents where you need full trajectory detail: every model call, tool call, retrieval step, handoff, and error, in the order they happened.
Example:
pip install "prismtrace-sdk>=0.5.1"Then attach a handler to your framework. The SDK works with LangChain, LangGraph, Google ADK, LiteLLM, and the OpenAI Agents SDK, and wraps the Anthropic Python client directly. The current release is 0.5.4; the minimum version that works is 0.5.1.
Zero-code proxy, the fastest path with no code changes. Update the base URL in your model client configuration:
Example:
https://api.prism.blockconvey.com/proxy/openai/v1
https://api.prism.blockconvey.com/proxy/anthropic
https://api.prism.blockconvey.com/proxy/geminiPRISM forwards the call to the provider, records it, and runs your guardrail rules in both directions, before the prompt goes out and before the response reaches the user. Nothing is imported and no call site changes. This is the right choice when you want coverage quickly or when you don't control the application code that makes model calls.
OpenTelemetry, if your team already exports traces via OTel, point your OTLP exporter at https://api.prism.blockconvey.com/api/otlp with the protocol set to http/protobuf or http/json. No PRISM SDK required. Sessions are grouped only from declared attributes (gen_ai.conversation.id, session.id, or prismtrace.session_id); PRISM doesn't infer them.
HTTP API, one POST after each model response. The right choice for TypeScript, Go, Java, or any framework the SDK doesn't cover. Send the request to https://api.prism.blockconvey.com/api/traces with the X-PRISMtrace-Key header. See the full list of supported frameworks and connectors.
All four paths are available on every plan.
Step 4: Set up evaluation so quality failures surface automatically
Collecting traces gives you a record. Evaluation turns that record into a signal.
Without scoring, you have to read individual traces to know whether the replies were good. That doesn't scale past a handful of conversations a day. Evaluation attaches a verdict to every trace automatically, so the ones worth looking at rise to the top.
Automatic scoring on every trace. Every trace is analyzed on arrival, at no credit cost, whether or not you ask for it. Each one receives a customer satisfaction score (0–100), a response quality score covering accuracy, helpfulness, and clarity (0–100), the intent detected, and a flagged-for-review mark with a one-line reason. A trace is flagged when either score falls below 40, the reply looks like a hallucination, the user seems very frustrated, or the conversation contradicts itself. This runs on every trace, not a sample.
Deterministic rules. A deterministic rule produces the same verdict for the same input, with no model involved. Because there's no inference cost, deterministic rules run on 100% of sessions with no ceiling. Use them for things that have a clear right answer: regex patterns, keyword blocks, language restrictions, PII patterns.
LLM-as-judge. An LLM judge reads each exchange and scores it against a rubric you define. It runs on every incoming trace until the plan's daily allowance is reached (Free: 100 traces a day; Builder: 200; Growth: 500), after which only deterministic rules run until midnight UTC. The judge is not sampled, it scores every trace in sequence until the ceiling, then pauses.
Industry-specific checks. For financial conversations, PRISM flags rate promises and regulated-activity language. For healthcare conversations, it flags PHI exposure and unsafe medical advice. For legal conversations, it flags privilege risk. These run automatically when the conversation's industry is detected; you don't configure them.
The Evaluators page explains how to build custom evaluation rubrics on top of the automatic scores. Custom evaluators and the Evaluators Hub are available on the Builder plan and above.
How this looks in production
Here is a minimal HTTP trace submission and what PRISM does with it.
Sending the trace (Example)
POST https://api.prism.blockconvey.com/api/traces
X-PRISMtrace-Key: pt-sk-…
Content-Type: application/json
{
"project_id": "proj_abc123",
"model": "gpt-4o",
"input_messages": [
{"role": "user", "content": "What is my account balance?"}
],
"output_message": "Your current balance is $1,240.50.",
"latency_ms": 820,
"session_id": "sess_xyz789",
"token_count_input": 14,
"token_count_output": 11
}What PRISM returns
{
"id": "trace_…",
"cost_usd": 0.00024,
"session_id": "sess_xyz789"
}What happens automatically after the 200
- Storage. The trace is stored with its full prompt and response text (unless you've enabled content-free ingest for that project).
- Automatic scoring. PRISM analyzes the exchange and attaches a satisfaction score, a response quality score, the intent it detected, and a flagged-for-review mark if either score falls below 40 or the reply looks like a hallucination. This happens at no credit cost on every trace.
- Session grouping. Because this trace includes a session_id, PRISM adds it to that session. The Sessions view assembles all traces sharing that ID into one conversation in order, so you can read the multi-turn exchange and see where things went wrong. Traces without a session_id are stored individually but can't be retroactively grouped.
- Guardrail checks. Any guardrail rules you've set for this project run against the exchange. If a rule triggers, the event is recorded against this trace and appears in the Guardrails view.
- Model Inventory update. The model field updates the model's trace count, average latency, and last-seen timestamp in the Model Inventory automatically.
The result is visible in the Agent Observability views: Traces, Sessions, Agent Runs, and Scores & Alerts. No separate configuration needed for any of this, it runs on every trace the moment it arrives.
Send your first trace and see it scored automatically: start free.
Common mistakes
1. Tracking only latency and errors, and missing quality entirely.
Latency and error rate tell you whether the model responded. They don't tell you whether the response was correct or useful. A model that consistently gives wrong answers quickly, with no errors, looks fine in a standard dashboard. Add quality scoring, even just the automatic satisfaction and response quality scores, so low-quality replies surface without you reading every trace.
2. Not sending a session_id for multi-turn conversations.
Without a session_id, each trace is an isolated exchange. You can see that individual replies scored poorly, but you can't see the conversation that produced them: what the user tried, how the model's answers evolved, where things went off track. Session grouping can't be backfilled, you can't add a session_id to old traces after they've been ingested. Set it up at the start, before you have traffic you want to analyze.
3. Omitting the model field.
The model field is required. Without it, the trace is incomplete and the Model Inventory, which builds itself from the model and agent_id fields on your traces, has nothing to work with. If you run several agents or switch models over time, an incomplete Model Inventory makes it impossible to compare performance across models or spot when a model change affected quality.
4. Treating automatic scores as a final verdict.
Automatic scores are a triage signal, not a ground truth. They flag which traces are worth looking at. A flagged-for-review trace has a one-line reason (hallucination, low satisfaction, contradiction), but that reason is a starting point. Build a habit of reviewing flagged traces regularly, especially after a prompt change or a Knowledge Base update, and use custom evaluators to encode the rules that matter most for your specific application.
How do you monitor LLM outputs in production?
Send each exchange to an observability platform as a trace with the prompt, reply, latency, and token counts. Then:
- Score automatically. Every trace is analyzed on arrival. Satisfaction and response quality scores flag the replies worth reviewing without manual effort.
- Set alerts on quality signals. Configure alerts on satisfaction score drops, error rate spikes, or guardrail block rate increases. An alert has a metric, a condition, a threshold, and a severity, and can be scoped to one agent. It fires a notification email when the condition is met.
- Group traces into sessions. For multi-turn applications, include a session_id on every trace that belongs to the same conversation. The Sessions view assembles them in order and shows how the conversation drifted or failed across turns.
The combination of per-trace scoring, session grouping, and threshold alerts means quality problems surface automatically rather than waiting to be discovered by a user complaint.
What metrics should you track for LLM observability?
The core metrics fall into two groups: operational and quality.
Operational metrics tell you how the model is performing as infrastructure:
- Token counts (input and output, for cost tracking)
- Cost per run
- Error rate
- Traces per hour
- Guardrail block rate
Quality metrics tell you whether the model is being useful:
- Customer satisfaction score (0–100)
- Response quality score (0–100, covering accuracy, helpfulness, and clarity)
- Intent detected per exchange
- Trace failures per hour (exchanges flagged for review)
For multi-turn applications, add session-level metrics: how often does a conversation end with the user's goal met, and how does that rate change over time.
Related
- AI observability toolsHow to choose one, a practical comparison of what to look for when evaluating platforms
- Agent ObservabilityTraces and Sessions, how PRISM by Block Convey assembles traces into sessions and surfaces failures
- Evaluators, how to build custom evaluation rubrics on top of automatic scoresEvaluators, how to build custom evaluation rubrics on top of automatic scores
- AI Agent and LLM Integrations, every supported framework and connectorAI Agent and LLM Integrations, every supported framework and connector
- AI Testing and Observability Guides, more guides on reliability, evaluation, and agent testingAI Testing and Observability Guides, more guides on reliability, evaluation, and agent testing
See your first trace scored automatically
Connect your application, send one trace, and PRISM scores it for quality and satisfaction on arrival, with no configuration needed.
Free to start, 100 credits each month.