Eval metrics lab
Add observability and tests
Metrics for groundedness, citation_precision, p95_latency_ms must distinguish bad input from component failure for ML engineer gating a prompt change before Friday release.
1Learn the idea
Read
Golden signals for this system
Instrument offline+online eval harness for grounded support answers so ML engineer gating a prompt change before Friday release can answer: demand, errors, latency/age, saturation. Emit fields needed by groundedness, citation_precision, p95_latency_ms with bounded labels. Sample successful high-volume traces; keep errors and rollout transitions denser within policy.
Read
Alert path worth paging
Define at least one alert that would fire for EVAL-LEAK-308, with a for/pending window that survives deploy blips. Missing scrape or missing revision labels must not look like health. Include a trace/log example id format you will actually search.
Read
Implementation artifact
emit("eval_groundedness", value=report.groundedness, gold="v12", prompt=prompt_sha)
Read
Tests for telemetry
Add a unit/integration check that metrics increment on the happy path and on the eval set leaked into few-shot examples — scores look perfect, prod drops branch. Store machine-readable output in CI artifacts when practical.
Read
Stage depth
Cardinality discipline: tenant and revision are usually enough; raw question text is not a label. Exemplars or trace links beat screenshots alone when debugging EVAL-LEAK-308. Define who owns alert fatigue review. If you export to a vendor, record retention and access. Synthetic probes should use non-sensitive fixtures and still exercise python -m eval.run --gold v12. Practice the query you will type at 2am once, while calm.
Read
Field notes for `eval-metrics-lab` / `observability`
Document the exact PromQL or log query in the runbook stub for this service. Verify histograms have buckets around your SLO target. Add a canary synthetic check that exercises the oracle path every few minutes in staging. Confirm that PII redaction happens before export. Track build/version as a label on the golden signals. Delete noisy debug logs before they become accidental product dependencies. In this chapter the product is offline+online eval harness for grounded support answers, the human stakeholder is ML engineer gating a prompt change before Friday release, and the incident id you design against is EVAL-LEAK-308. Re-state the oracle in your notes — candidate prompt beats baseline on groundedness by ≥ 0.03 without latency regression > 10% — and keep the invariant visible: release needs groundedness ≥ 0.88 and latency p95 ≤ 2.0s on fixed gold set v12. Track groundedness, citation_precision, p95_latency_ms as the scoreboard. Surface under change control: python -m eval.run --gold v12. If you only have forty minutes, finish the fixture for eval set leaked into few-shot examples — scores look perfect, prod drops before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Read
Extra rehearsal for Eval metrics lab (observability)
Set a timer for twelve minutes and attempt only the observability concerns for Eval metrics lab. Speak aloud what ML engineer gating a prompt change before Friday release would see on success versus on eval set leaked into few-shot examples — scores look perfect, prod drops. Write three bullet artifacts you must keep: a fixture name tied to EVAL-LEAK-308, a metric query for groundedness, citation_precision, p95_latency_ms, and the rollback or refuse command for python -m eval.run --gold v12. Then extend the notes with one sentence on how release needs groundedness ≥ 0.88 and latency p95 ≤ 2.0s on fixed gold set v12 would be violated if you skipped this page. Close by restating the oracle in your own words without looking: candidate prompt beats baseline on groundedness by ≥ 0.03 without latency regression > 10%.
Go deeper
Before you start
Why this matters
Name the dashboard row or log line ML engineer gating a prompt change before Friday release opens first during EVAL-LEAK-308. It must include a correlation id and a bounded label from groundedness, citation_precision, p95_latency_ms. If telemetry is missing, write whether you promote, hold, or roll back — and why hold is the default.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.