What it is
AI observability is the practice of recording what LLM-based features do in production, request by request: inputs, retrieved context, model and prompt versions, outputs, tokens, timings and user feedback. AI evaluation is the practice of measuring answer quality systematically: offline, on a fixed set of cases before a change ships, and online, on samples of live traffic. Together they answer two questions ordinary monitoring cannot: why did it say that? and is this version better than the last one?
Why it exists
LLM features fail in ways that do not show up as errors. A hallucinated discount code, an outdated policy, a broken output format or a refusal to answer a legitimate question is still an HTTP 200 with normal latency, as the simulation's green dashboard shows. Outputs are non-deterministic, depend on prompts, retrieved data and model versions that all change independently, and providers update models over time. Without traces you can't explain a bad answer; without evals you can't tell whether a change helped or hurt.
How it works
Tracing. Each request becomes a trace with spans for each step: retrieval (query, returned chunks and scores), each model call (model and version, prompt template version, parameters, input/output/cached token counts, time to first token, total time, finish reason), tool calls for agents, and the final output. User feedback (explicit ratings, implicit signals such as retries, copies or escalation) is attached by trace id. OpenTelemetry's generative AI semantic conventions define common attribute names (gen_ai.*); they are still evolving, so pin the version you emit. Export asynchronously so tracing never slows requests.
Privacy. Prompts and outputs often contain personal or confidential data. Decide what content to capture (all, sampled, or metadata only), redact identifiers, restrict access, and set retention. Many teams capture full content only for sampled or flagged traces.
Online metrics. Per route and per version: latency (time to first token and total), tokens and cost per request, error and refusal rates, feedback rates, retrieval coverage, and sampled quality scores. Compare by version and by segment; averages hide regressions in small but important groups.
Offline evaluation. A versioned dataset of representative cases: real questions (anonymised), with what a good answer must contain or must not contain, plus hard cases and every past production failure. An eval runner executes the pipeline on each case and grades with, in order of preference: deterministic checks (schema validity, required citation, exact facts, forbidden content), reference-based comparisons, and rubric-based grading by a judge model or humans. The output is a score per version with per-case results, so you can see which cases changed.
LLM-as-judge. A model grades outputs against a rubric, or picks the better of two answers. It scales where human review can't, but it has known biases: position (favouring the first answer in pairwise comparisons), verbosity (favouring longer answers), self-preference (favouring its own style or model family), and run-to-run inconsistency. Mitigations: specific rubrics with binary criteria, swapping order and discarding inconsistent verdicts, a pinned judge model and prompt, and regular measurement of agreement with human labels.
Uncertainty. Eval scores are estimates. With n cases and pass rate p, the standard error is about √(p(1−p)/n): for 200 cases at 85%, roughly ±5 points at 95% confidence. Compare versions on the same cases (paired), look at which cases flipped, and don't celebrate a two-point gain on a small set.
Regression gates and rollout. Run the eval set in CI for every change to the model, prompts, retrieval configuration, tools or judge. Block changes that drop beyond the noise margin or fail critical cases. Then roll out like any risky deploy: canary a small share, tag traces with versions, compare online metrics, and keep rollback a configuration change (an LLM gateway or router makes this easy).
When to use it
- Any LLM feature that users depend on: from the first production release, not after the first incident.
- Before changing models, prompts, chunking, embeddings or retrieval parameters.
- Agents, where a single request has many steps and failures are hard to reconstruct without traces.
When not to
- Heavy evaluation infrastructure for a throwaway prototype: a spreadsheet of 30 cases and manual review is enough to start.
- Full content capture where regulation or contracts forbid storing prompts: capture metadata and sampled, consented content instead.
- LLM judges for criteria that code can check exactly (format, presence of a citation, numeric correctness).
Trade-offs
| Choice | You gain | You pay |
|---|---|---|
| Capturing full prompts and outputs | Explainable failures, eval data from production | Storage, privacy risk, access control |
| LLM judge instead of human review | Scale and speed | Bias and noise; needs calibration |
| Larger eval set | Detects smaller regressions | Cost and time per run; curation effort |
| Strict CI gate | Fewer silent regressions | Slower iteration; false blocks from noisy scores |
| Online sampling rate | More quality signal | Judge cost on live traffic |
Alternatives
- Human review only: highest quality labels, doesn't scale; best used to calibrate automated graders.
- A/B tests on business metrics (resolution rate, conversion): the ground truth that matters, but slow and confounded.
- Vendor or community benchmarks: say little about your data and your prompts; never a substitute for your own eval set.
Failure modes
- Silent quality regressions after a model update, prompt edit or document change, invisible in latency and errors.
- Overfitting to the eval set: prompts tuned until the score rises while real traffic gets worse. Refresh cases from production and hold some out.
- Stale eval sets that no longer reflect what users ask.
- Judge drift: the judge model changes and all scores shift. Pin it and re-calibrate when you must change it.
- Leaky traces: personal data copied into observability tools with broad access.
- Metric blindness by aggregation: an average that hides a severe regression in one language or customer segment.
In production
Instrument the pipeline once, centrally (an SDK wrapper or the LLM gateway), with model, prompt and retrieval versions on every span. Keep prompts, rubrics and eval datasets in version control and run evals in CI. Build dashboards by version and segment, alert on feedback-rate and cost-per-request changes as well as latency and errors, and run a judge on a small sample of live traffic. Review a handful of real traces every week; the patterns you find become new eval cases. Treat a provider's model update like a dependency upgrade: pin versions where you can, and evaluate before moving.
Common misconceptions
- "No errors means it works." A wrong answer is a successful response.
- "The judge's score is the truth." It is another model's opinion, with measurable biases.
- "One good eval run proves a change is better." Small differences on small sets are noise; look at per-case changes.
- "Benchmarks tell us which model to use." They tell you about the benchmark. Your eval set tells you about your product.
- "Observability means logging prompts." It means structured traces with versions, tokens, timings and feedback that you can query and compare.
Interview angle
For any LLM system design, add an observability and evaluation section unprompted: what each trace contains, how personal data is handled, which online metrics and alerts you'd set, how the golden set is built and grown, how judges are calibrated, and how a model change is gated and rolled out. Quantitative awareness stands out: "200 cases gives about ±5 points, so we compare paired results and only block on drops beyond that, or on any critical case failing".
Model assumptions
The simulation covers only the serving path, as a simplified queueing model: a RAG app (10 ms of work) reads a retriever modelled as a database (32 connections, 40 ms per read) and calls a model through a router using smooth weighted round robin. Model v1 has 32 concurrent slots and a 1.2 s mean call time; Model v2 takes 2.0 s as first rolled out (longer answers) and 1.5 s after its prompt is fixed (lognormal, cv 0.5). The engine measures throughput, latency and errors and has no notion of answer quality. Tracing, feedback, eval runs and the judge model are scripted illustrations, and every quality score shown (86%, 78%, 85%, groundedness 0.82) is illustrative. Arrivals are Poisson; network hops are fixed. Numbers show behaviour and orders of magnitude only.