Q&A-1Define observability objectives for an LLM product.
Answer
Assume a B2B support assistant: 50k sessions/day, streaming, RAG over a 40k-doc index, one tool call into a ticketing API. The product promise is "resolve the ticket or hand off cleanly," so every objective traces back to that, not to token counts.
| SLI | Definition | Window | Objective | Page at |
|---|---|---|---|---|
| Availability | edge requests that emit a first token within 2s and don't 5xx | 28d rolling | 99.5% | 99.0% |
| Verified completion | sampled sessions a rubric grader marks resolved or cleanly handed off | 28d, 200 sessions/day | 78% | 73% on a 3-day mean |
| Safety | confirmed policy violations reaching a user, per 10k sessions | 28d | 0 | any single confirmed one |
| Latency | p95 time-to-first-token / p95 full response | 28d | 1.2s / 9s | 2.0s / 15s |
| Cost per success | (token + retrieval + tool spend) / verified completions | 28d | ≤ $0.05 | $0.07 |
Availability has to be defined at first token, not at completion. A 30-second generation that eventually succeeds is not an outage, and a stream that dies at token 400 is: measuring at completion conflates the two.
Verified completion is the SLI that decides whether the rest is trustworthy. A model grader costs about $0.003/session and runs on 100% of the 200-session daily sample; human review costs roughly $4/session, so I run 20 of those a day purely to audit the grader. Track Cohen's kappa between them weekly. Above 0.85, the cheap grader is the SLI. Below it, the completion number is measuring grader leniency, and I fall back to the human-only slice and widen the window.
The sample size sets the page threshold. At p̂ = 0.78 and n = 200, the standard error is sqrt(0.78 × 0.22 / 200) = 0.029, so the 95% interval is ±5.7pp. Daily noise is wider than any threshold worth paging on, which is why the page condition is a 3-day rolling mean, not a single day.
Cost per success is where the denominator earns its keep. At 50k sessions, 6k input tokens and 700 output tokens each, input runs 300M tokens at $3/M = $900, output 35M at $15/M = $525, retrieval $100, tool calls $50: $1,575/day. Per request that's $0.0315. Per verified completion, 39,000 of them, it's $0.0404, 28% higher. Optimizing the per-request number rewards failing faster.
Model version, prompt-template hash, retrieval index version, agent step count, tool error rate and cache hit rate are cause metrics. They never appear as objectives; they're what you slice by when an SLI moves.
Failure modes, with illustrative numbers:
- Grader drift. Kappa was 0.91 in month one and 0.68 three months later after a model upgrade. The completion SLI silently became a measure of grader leniency. Detected by the weekly audit; the fix is re-anchoring the rubric, not re-tuning the threshold.
- Retry inflation. Retries counted as separate edge requests push availability up. Compare edge request count to session count: a ratio above 1.15 means retry storms are masking real failures.
- Missingness. If the grader only runs on sessions that completed, failures never enter the denominator. Compare sampled to total sessions per hour; a gap over 2% is a hole, not noise.
- Agent loops. TTFT stays fine while p99 full response goes 9s → 40s because the agent retries a failing tool. The step-count histogram shows it: anything past 6 steps is the tail.
Rollback: verified completion more than 5pp under objective for two consecutive days reverts the prompt or model change; 3pp for one day opens a ticket. Privacy: log hashed session IDs and grader labels, never raw prompts. The PII in a support ticket is the whole reason the product exists.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.