Writing
2026-10-01 · 13 min

Observability for production AI systems

Observability for LLM-backed systems isn't MLOps monitoring with a new label. The model is stochastic, the inputs are open-ended, the cost is per-token, and the failure modes are often invisible to standard metrics. Latency can look fine while the answers are quietly wrong. CPU can be flat while a prompt change has halved recall. You need a different shape of telemetry to see what is actually happening — and you need to tell it apart from evaluation, which answers a different question.

What observability has to answer, in order

  1. Is the system up? Can users reach it, is the error rate acceptable, is latency within SLO?
  2. Is it answering well right now? Not perfectly — well enough, by the thresholds the business signed off on.
  3. How much is it costing per request, per feature, per tenant? Because this is the metric that moves fastest without being noticed.
  4. When something went wrong, what exactly happened? Which prompt, which model version, which retrieved passages, which tool calls, which output.

A production LLM system that cannot answer those four questions is not observed; it is just hopeful.

Observability, monitoring, evaluation — three different jobs

People use these words interchangeably and it costs them clarity when something breaks. I keep them separate:

  • Monitoring watches known signals and raises an alarm when they cross a threshold. CPU, memory, 5xx rate, p95 latency. You decide in advance what to look at.
  • Observability lets you ask questions you did not know you'd have. High-cardinality traces, structured logs, replayable context. You decide what to look at after the fact.
  • Evaluation measures quality against a reference. Golden sets, LLM-judge scoring, A/B. You decide whether the system is good enough.

Monitoring and observability answer what is happening. Evaluation answers whether it is good. A dashboard full of green charts does not mean the answers are correct; it means nothing you're watching has broken.

SLIs that actually matter for LLM systems

The four golden signals from classic SRE (latency, traffic, errors, saturation) still apply. But LLM systems need four more, and they are the ones that bite.

Quality SLIs

  • Groundedness rate — share of answers whose spans are supported by retrieved context. Sampled, judged by an LLM or human.
  • Citation accuracy — of the citations the model emits, how many actually contain the claim.
  • Refusal appropriateness — rate of correct refusals plus rate of wrong refusals. Both matter.

Safety SLIs

  • Content-filter trip rate, split by category and severity.
  • PII leakage rate — detected via regex and classifiers on both input and output.
  • Prompt-injection trip rate — on classifier or structural heuristics.

Cost SLIs

  • Cost per successful request, split by feature and tenant.
  • Token efficiency — the ratio of generated tokens to prompt tokens. If this collapses, something has started generating long and lazy.
  • Cache hit rate on prompts and retrieved contexts.

Retrieval SLIs (if you ground)

  • Recall@k on a golden query-passage set, re-run on every change to ingestion, chunking or embedding.
  • Reranker lift — recall improvement from the reranker, so you can tell when it stops earning its latency budget.
  • Stale-context rate — share of returned chunks older than the freshness SLO for that source.

Each of these can regress silently from a prompt change, a model version bump, a data ingestion blip, or a reranker swap. If nothing watches them, the regression ships.

What a single trace must preserve

A trace is the per-request record you can replay. If a trace is missing a field, that field cannot be used in a postmortem. The non-negotiable fields for an LLM system:

  • Correlation IDs — request, session, user (hashed where needed), tenant, and parent span.
  • Input snapshot — the user message, system prompt version, context variables, and any tool-call history.
  • Retrieval record — query, retriever version, index name, passage IDs, similarity scores, reranker scores, final k, and the content hash of each passage used.
  • Model record — deployment name, version, temperature, top-p, max tokens.
  • Tool-call chain — each tool, arguments, response status, duration.
  • Output — the raw generation, token counts, finish reason, content-filter category and severity, cost.
  • Decision trail — any validator, guardrail or policy decision applied to the output and why.
  • Latency breakdown — per-span duration, so you can see whether the time went to retrieval, generation, tool call or your own code.

Store the content hashes of the prompt, context and output; store full text only inside your retention window. Keep hashes forever so you can prove a specific trace existed and link it to a specific prompt / passage version.

Sampling without blinding yourself

Full-fidelity capture gets expensive fast. The pattern that works:

  • Always sample errors, policy-violating outputs, low-confidence outputs, content-filter trips, long-tail latency, and anything with a tool-call error.
  • Head-based sample normal successful traffic at 1–10%, boosted for new features and tenants.
  • Keep sampling decisions in the trace itself so you can account for what you dropped later.

Dashboards, alerts, replays — what belongs where

A dashboard that tries to serve all three roles ends up serving none. I separate them:

  • Health dashboard — one screen, the top four golden signals plus groundedness rate, content-filter trip rate, cost per successful request, and cache hit rate. If the oncall picks it up, this is what they see first.
  • Feature dashboards — one per shipped flow (RAG assistant, agentic claims, document extraction). Deeper SLIs, broken down by tenant where relevant.
  • Alerts — SLO-burn alerts, not threshold alerts. Noisy threshold alerts get muted, which is worse than no alert at all.
  • Replay — a trace explorer you can filter by any of the fields above. This is where postmortems happen. If it's inaccessible to the people who need it, it may as well not exist.

The stack I actually run

You can assemble a production-grade observability stack for LLM systems out of open-source parts, and I usually do, because vendor lock on telemetry is the worst kind of lock.

  • OpenTelemetry SDKs for instrumentation, with the GenAI semantic conventions as the attribute schema. Portable across backends.
  • A traces/metrics/logs backend you already run — Tempo + Prometheus + Loki, or Honeycomb, or Azure Monitor if you're already in Azure. Keep this layer generic.
  • An LLM-aware trace tool on top for the GenAI-specific views: Langfuse, Phoenix (Arize), or OpenLLMetry. These understand that a trace has a prompt, a model version, retrieved passages and a cost, so you don't have to roll those views yourself.
  • Evaluation runs as scheduled jobs that write results into the same telemetry store as everything else, so a regression in groundedness shows up on the same timeline as a deploy.

Anti-patterns

  • Treating prompt text as a secret. It isn't a secret, it's a dependency. Version it, hash it, log the hash on every trace.
  • Logging only the final answer. The retrieval, tool calls and intermediate reasoning are where the explanation lives. Without them, every investigation starts at "we don't know."
  • Alerting on raw metrics with no SLO. You pay oncall for a false alert twice: once for being woken up, once for the trust lost.
  • Confusing a model-provider dashboard with observability. The provider sees their side. You need yours.
  • Shipping without a trace of the training/evaluation set used. If an answer went wrong, you need to know which model, pinned to which dataset snapshot, produced it.

A short checklist

  1. Every request produces a trace with correlation IDs, prompt hash, model version, retrieval record, tool calls, output and cost.
  2. Quality, safety, cost and retrieval SLIs are defined, measured and shown on a health dashboard.
  3. Alerts fire on SLO burn, not raw thresholds.
  4. Evaluation runs on every change to prompt, model, retriever or data; results land on the same timeline as deploys.
  5. A trace explorer is accessible to engineering and the oncall rotation, and filterable by every field a postmortem might need.

None of this is exotic. It is boring, structured, deliberate. Which is exactly how operating an LLM system in production is supposed to feel.