Why this matters
AI features can degrade without errors (quality drift) and get expensive without traffic growth (longer prompts, loops, abuse). The usual RED metrics aren't enough; you need quality and cost signals too. Job descriptions name them explicitly: latency, cost per query, accuracy drift and token usage.
Instrument every call
Per call: request ID, tenant, feature, model and version, prompt version and fingerprint, input/output/cached tokens, cost, time to first token, total latency, retries, fallback used, outcome (ok, schema violation, refusal, incomplete, error class). For agents add step number, tool name and outcome. Tools: OpenTelemetry plus an LLM tracing tool (Langfuse, LangSmith, Phoenix, cloud-native tracing). Don't log raw content containing personal data by default.
Q36. Your AI dashboard?
| Layer | Metrics |
|---|---|
| API | Rate, errors, p50/p95/p99 |
| Provider | Latency, timeouts, 429s, errors by class |
| Cost | Tokens in/out, cache hits, cost per successful task |
| RAG | Recall@k on the eval set, empty-retrieval rate |
| Generation | Faithfulness, schema violations, refusals |
| Agent | Steps per task, tool success, loops, approvals |
| Product | Corrections, acceptance, abandonment |
Say: "Latency, cost per query, accuracy drift and token usage: the four things job descriptions list are four rows of that dashboard."
Drift
- Input drift: users ask new kinds of questions (watch topic clusters, empty-retrieval rate).
- Model drift: the provider changes behaviour (pin versions; run scheduled evals).
- Data drift: documents change or go stale (index freshness metrics).
- Quality drift: sampled judge scores, correction rates and acceptance trend down.
Cost control
- Budgets per tenant and per feature, with alerts at 50/80/100%.
- Hard caps on
max_tokensper request class and on agent spend per run (9.6). - Cost per successful task tracked weekly; investigate jumps.
- The levers list in Q37.
Common mistakes
- Monitoring uptime only.
- Cost dashboards by provider bill, monthly, too late to act.
- Tracing that stores full prompts with personal data.
Interview follow-ups
- "Cost doubled overnight with flat traffic. Where do you look?" Tokens per request (prompt growth, bigger retrieved context), retries and fallbacks, agent steps per task, cache hit rate, a model or route change, one tenant's usage.
- "What's the most important AI metric?" Cost per successful task, alongside a quality measure, because it combines spend, reliability and usefulness.
Check yourself
Name the seven layers of an AI dashboard.
API, provider, cost, RAG, generation, agent, product.
Quality complaints rise but error rate is flat. Where do you look?
Sampled judge scores and correction rates over time; whether the model version or prompt changed; retrieval metrics (empty retrieval, recall on the eval set); index freshness; new query types appearing.
Build it
Instrument your project's model calls with the fields above, send them to a tracing tool, and build a one-page dashboard with cost per successful task.