Interview's MateAI Engineering
Interview's Mate

AI Engineering

LLMs, RAG, agents & evals

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
AI Engineering topics
Lesson 139/ 160
07. Deployment

Alerts and Dashboards

Monitor error rate, latency, cost, and eval scores with actionable alerts.

IntermediateSLOs · Alerts3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidHands-onQuiz (3)Practice

In plain words

Dashboards show how your AI app is doing in pictures, and alerts tap you on the shoulder only when something important needs fixing.

Think of it like…

A car dashboard and warning lights: gauges show speed and fuel at a glance, and a warning light only turns on when you must act, with the manual (runbook) telling you what to do; a car that flashed warnings constantly would train the driver to ignore them.

Where you’ve seen it

The service has an availability SLO of 99.5% over 30 days. At 100,000 requests a day that is 3,000,000 requests a month, so the error budget is 0.5% = 15,000 failed requests. Burn-rate alerts use multiple windows: a fast burn of 14.4× the allowed error rate for 1 hour (checked also over 5 minutes) pages immediately because it consumes 2% of the monthly budget in an hour (14.4 × 0.5% = 7.2% errors, about 300 of 4,167 hourly requests); a slow burn of 6× over 6 hours (3% errors) pages too, consuming 5% of the budget; a 1× burn over 3 days opens a ticket. Complete outage for one hour would cost 4,167 failures, 27.8% of the monthly budget. AI-specific alerts: cost per request more than 15% above the 7-day baseline ($0.01195) for an hour, p95 time to first token above 1.5 s for 15 minutes, tool-call error rate above 5%, safety-flag rate doubling, queue age above 60 seconds and the sampled judge score (rolling 500 requests) dropping more than 3 points. The main dashboard has a top row with SLO status and budget remaining, golden-signal panels by endpoint, AI panels (tokens, cost, TTFT, refusals, quality), per-variant splits and deploy markers; every alert links to a runbook with first checks (provider status, recent deploys, flag changes) and rollback steps. The team reviews alert quality monthly: pages per on-call shift fell from 14 to 2 after removing cause-based alerts like "CPU > 80%".

Words you’ll hear

SLO / error budget
A target reliability level and the allowed amount of failure.
Burn rate
How fast the error budget is consumed relative to plan.
Golden signals
Latency, traffic, errors and saturation.
Runbook
A documented response procedure linked from the alert.

Visual diagram

Loading interactive diagram

Theory & deep dive

SLOs, error budgets and burn-rate alerts

Define SLIs (service level indicators) from the user's view, such as the share of requests that succeed within 5 seconds, then set SLOs (99.5% over 30 days). The error budget is 1 − SLO of events: 0.5% of 3,000,000 requests = 15,000 allowed failures. Burn rate = observed error rate ÷ allowed error rate; a burn rate of 1 consumes exactly the budget over the window. Alert on burn rates over multiple windows (as recommended in the Google SRE workbook): 14.4× over 1 hour (with a 5-minute short window to stop alerting once resolved) consumes 2% of the monthly budget in an hour (14.4 × 720⁻¹ × 100 = 2%) and pages; 6× over 6 hours consumes 5% and pages; 1× over 3 days creates a ticket. At 4,167 requests an hour, 14.4× equals a 7.2% error rate (300 failed requests in the hour).

Why this works: it ties alerts to user impact and budget, not to arbitrary thresholds; fast burns catch outages immediately while slow burns catch chronic degradation without paging at 3 a.m. for harmless blips. Decide what counts as an error for AI services: HTTP 5xx, timeouts, schema-invalid outputs, refusals that shouldn't have happened (carefully), tool-call failures and, with a sampled judge or user feedback, quality failures. Use separate SLOs for latency (p95 time to first token under 1.5 s for 99% of 5-minute windows) and quality (sampled pass rate above a floor), since a fast, wrong answer is still a failure.

Budget arithmetic

SLO 99.5%, 3,000,000 requests/month → 15,000 failures allowed. 14.4× burn for 1 h: 7.2% errors × 4,167 requests ≈ 300 failures = 2% of the budget. A 1-hour total outage: 4,167 failures = 27.8% of the budget.

Key takeaway: Alert on burn rates of SLO budgets across windows, and extend SLOs to latency and quality, not just uptime.

AI-specific signals, dashboards and alert hygiene

AI signals to monitor: cost per request and tokens in and out (alert against a 7-day baseline: +15% for an hour often means a prompt or routing change), time to first token and inter-token latency, provider error and 429 rates by provider and model, tool-call error and retry rates, refusal and safety-flag rates, cache hit rate, queue depth and age for workers, GPU utilisation and KV-cache usage for self-hosted models, and quality scores from a sampled LLM judge (rolling 500 requests) and user feedback (thumbs-down rate). Slice by prompt version, model, variant and tenant so regressions localise. Combine static thresholds for hard limits (queue age above 60 seconds) with baseline-relative or anomaly-based rules for drift in cost and quality.

Dashboard design: one overview (SLO status, budget remaining, current incidents), one service dashboard per component with golden signals, an AI quality and cost dashboard (per version and variant), a provider health view and drill-downs to traces. Use consistent layouts, deploy and flag-change annotations on every time series, units and thresholds on panels, and avoid vanity metrics. Alert hygiene: page only on user-impacting symptoms needing immediate human action; send the rest to tickets or chat; attach runbooks (first checks: provider status, recent deploys, flag changes, rollback command); deduplicate and group alerts, set sensible for durations and review them monthly. Track pages per shift, actionable ratio and time to acknowledge: the example fell from 14 pages per shift to 2 after deleting cause-based alerts such as high CPU and adding SLO burn alerts.

A cost alert

7-day mean cost per request $0.01195. Alert when the 1-hour mean exceeds $0.01374 (+15%) for 60 minutes. A prompt change adding 800 tokens lifts it to $0.01395 within the canary window, triggering an alert and a link to the prompt-version diff and rollback runbook.

Key takeaway: Monitor cost, TTFT, tool errors, safety and quality alongside golden signals, with deploy annotations, runbooks and regular alert reviews.

How it works, step by step

Step 1 of 4
SRE + product

1. Define SLIs and SLOs

Choose user-centred indicators for availability, latency and quality, set targets and compute error budgets.

99.5% → 15,000 failures/month
Key numbers at this step
Count
invalid outputs as errors

When to use it & trade-offs

What it is

Alerts and dashboards turn telemetry into action. Dashboards give a shared, at-a-glance view of health: the golden signals (latency, traffic, errors, saturation) plus AI-specific signals (tokens and cost per request, time to first token, refusal and safety-flag rates, tool-call errors, cache hit rate, queue age, sampled quality scores and user feedback). Alerts notify people when something needs attention. Good alerting is symptom-based and SLO-driven: define service level objectives, compute error budgets and alert on burn rate (how fast the budget is being consumed) with multiple windows, route by severity (page versus ticket) and attach runbooks. The goal is high signal and low noise, so that a page always means a human must act.

Why it matters: AI systems fail in ways CPU graphs don't show: quality degrades silently, cost per request creeps up after a prompt change, a provider slows down, a refusal spike follows a model update. Without well-designed alerts, teams learn about incidents from users; with noisy alerts, they ignore pages. Linking alerts to user-facing objectives and to the AI-specific signals makes monitoring useful and sustainable.

When to reach for it

  • On-call for AI APIs and agents
  • Detecting cost and quality drift after releases
  • Reporting reliability to stakeholders

When to avoid or be careful

  • Paging on CPU or memory without user impact
  • Alerts without runbooks
  • Dashboards with no deploy annotations or version splits

Alerting approaches

SLO burn-rate alerts
Best for: User-impacting reliability

Strengths: Few, meaningful pages; tied to budgets.

Watch out: Requires well-defined SLIs.

Static threshold alerts (CPU, memory)
Best for: Resource limits and capacity warnings

Strengths: Simple.

Watch out: Noisy; often unrelated to user impact.

Anomaly or baseline-relative alerts
Best for: Cost, quality and traffic drift

Strengths: Catches gradual shifts.

Watch out: Needs tuning and good baselines.

Interview signals & numbers to know

When this topic comes up

  • “We learned about the outage from customers”
  • Error budget and burn rate
  • Golden signals
  • Cost per request alerts
  • Alert fatigue

Benchmarks & rules of thumb

99.5% = 15,000 failures -
error budget on 3M monthly requests
14.4× / 6× / 1× -
burn rates for 1 h, 6 h and 3 d windows
27.8% -
budget consumed by a one-hour full outage at 4,167 requests/hour

Common mistakes & follow-ups

Common interview mistakes

  • Setting thresholds on causes that don't map to user pain.
  • Alerting on quality without sample-size safeguards.
  • No ownership, so alerts are ignored.

Likely interviewer follow-ups

  • How would you design alerting for an LLM-backed API?
  • What is a burn-rate alert?
  • Which AI-specific metrics belong on the dashboard?
Interview tip: Show the error-budget arithmetic (15,000 failures, 14.4× burn). It proves you design alerts from objectives, not guesses.
Loading hands-on exercise

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Alerts and Dashboards with generative AI interview Q&A and hands-on practice.

Open Generative AI Q&A →Tech Learn Q&A
Previous topic
Health Checks
Next topic
Rollbacks