Quality & Cost Dashboards
- Choose the handful of metrics that actually belong on an AI-app dashboard
- Compute latency percentiles (p50/p95) and cost-per-request from your logs and traces
- Build a dashboard skeleton that turns the trace/log/eval streams into glanceable panels
- Run a weekly review ritual and communicate quality to non-technical stakeholders
| Spaced-rep warm-up: tracing + drift cards (D142/145) | 10 min |
| ELI5 + tech read: metric selection, percentiles, the ritual | 20 min |
| Guided: aggregate metrics + render the dashboard | 40 min |
| Practice: write the stakeholder weekly review | 15 min |
| Project: build the capstone dashboard skeleton | 25 min |
| Quiz + flashcards | 10 min |
Builds on: Day 142 β Tracing LLM applications Β· Day 143 β Logging, feedback & the data flywheel Β· Day 145 β Drift & continuous eval in prod
A cockpit does not show the pilot everything the plane knows β it would be a wall of noise. It shows the six or seven instruments that change a decision: altitude, airspeed, heading, fuel, attitude, engine health. Everything else is one layer down, available when a warning light sends you looking. The art is choosing which few numbers earn a permanent place in front of the pilot's eyes.
A quality-and-cost dashboard is your cockpit for the docs-QA service. You already have the raw telemetry β traces (Day 142), logs and feedback (Day 143), continuous-eval scores (Day 145). A dashboard is not more data; it is the ruthless selection of the few numbers that would actually change what you do this week: is quality holding, is it fast enough, is it too expensive, are users unhappy, is anything erroring? Five panels a stakeholder can read in ten seconds beat fifty a nobody opens. And like a cockpit, it comes with a ritual: you don't glance once and forget β you scan the instruments every week, and the scan is what catches the slow leak before the passengers feel it.
Two conversations decide whether an AI product survives, and both are dashboard conversations. The first is internal: "is it getting better or worse, and can we afford it?" β without cost-per-request and a quality trend, that turns into opinion. The second is the FDE's stakeholder update: an executive doesn't want your trace viewer, they want one screen that says quality is steady, p95 latency is under budget, cost per question is trending down, and here's the feedback rate. Being able to stand in front of a customer and narrate that screen β the "FDE muscle" the outline keeps naming β is often what renews the contract. Interviewers ask "what would you put on the dashboard for an LLM feature?"; a crisp, short answer signals you've actually run one.
Guided practice
Aggregate logs and traces into panel metrics
22 min- Write
obs/aggregate.pyfrom the starter. It readsrequests.jsonl(Day 143) andtraces.jsonl(Day 142) and producesobs/dashboard_metrics.json: requests/day, p50/p95 latency, mean and total cost, error rate, refusal rate, feedback-down rate. - Implement the percentile function yourself (sort + index) β do not reach for a library, so you understand exactly what p95 means.
- Join cost from the LLM spans (or from the request log's cost field) and confirm total cost = sum of per-request costs.
- Run it: terminal:
python obs/aggregate.pyand eyeball the JSON β sanity-check that p95 β₯ p50 and error rate is in [0,1]. - Fold in the Day-145
quality_timeseries.jsonlso the quality trend lands in the same metrics file.
Render a five-panel dashboard page
18 min- Write
obs/render_dashboard.pythat readsdashboard_metrics.jsonand writesobs/dashboard.htmlβ a self-contained page (inline CSS, no external calls) with five cards: Quality, Latency (p50/p95), Cost/request, Reliability (error + refusal), Volume. - Colour each card green/amber/red against the thresholds you set (e.g. p95 > 3000ms = amber, faithfulness < 0.80 = red). Thresholds live in one dict at the top.
- Open the HTML in a browser and confirm a stakeholder could read it in ten seconds.
- Add a one-line "as of <date>" and the total daily cost prominently β the number finance opens the page for.
- Keep it dumb on purpose: the intelligence is in the metric choice and thresholds, not the chart library.
On your own
Write the weekly review, for a stakeholder
15 minRun your aggregator on the traffic you've generated this week and write the actual weekly-review note a non-technical stakeholder would receive: three to five sentences, no jargon, stating whether quality held, whether latency and cost are within budget, the feedback rate, and the single most important action for next week. Then, separately, list the three traces (by ID) you would pull to investigate the worst panel, and which of them you'd file as a flywheel case. The skill being graded is translation: turning five numbers into a paragraph an executive trusts.
Hints: lead with the answer ("Quality is steady; cost is up 12% and here's why"), not the methodology. If a number crossed a threshold, name the action, not just the number.
Build the capstone dashboard skeleton
Ship the cockpit for your docs-QA service. Commit obs/aggregate.py, obs/render_dashboard.py, and a generated dashboard.html, wired to your real logs and traces. The dashboard must show, at minimum: online faithfulness trend (Day 145), p50/p95 latency, cost per request and total daily cost, error rate, refusal rate, and feedback-down rate β each colour-coded against a documented threshold. Add obs/review.md: the weekly-review ritual written down (what to scan, the thresholds, what a crossing triggers, the three-sentence stakeholder summary template) plus this week's filled-in review. Make make dashboard (or a shell script) regenerate everything from raw logs in one command.
Common mistakes & misconceptions
- Plotting everything you can measure. A fifty-panel dashboard is a wall nobody reads; pick the five numbers that change a decision.
- Reporting average latency. The mean hides the slow tail users actually feel β report p50 and p95, and never average two percentiles together.
- Omitting cost. Quality-only dashboards get the product killed by a surprise invoice; cost per request belongs next to quality, always.
- Building the dashboard and skipping the ritual. Observability is the weekly scan, not the HTML; without the review the slow leak still strands you.
- Showing engineers' internals to executives. Stakeholders need one glanceable screen and a three-sentence narrative, not your trace viewer.
- Treating refusal rate as harmless. A refusal-rate spike is often retrieval failing silently before any error is logged β watch it as a leading indicator.
Q1. Why report p95 latency instead of average latency?
Q2. Which set best belongs on an LLM-app cockpit?
Q3. A dashboard exists but quality still slips unnoticed for weeks. The most likely missing piece?
Go deeper β curated resources
- Grafana + Prometheus for LLM apps β β Sketch how each of your five panels would map to a Prometheus metric type (counter, gauge, histogram) β histograms are how real p95 is computed at scale.
- aggregate.py produces p50/p95, cost, error/refusal rates from real logs/traces
- dashboard.html renders colour-coded panels readable at a glance
- review.md defines the weekly ritual with a completed stakeholder summary
- One command regenerates the dashboard end to end
- Quiz β₯ 2/3
β Back: This turns Day 142's traces, Day 143's logs/feedback, and Day 145's quality time series into glanceable panels, and reuses Day 58's percentile intuition for the latency tail.
Forward β: Day 147 requires the dashboard populated for the observability gate; Day 157 graduates these panels into formal SLIs/SLOs with error budgets in Grafana/Prometheus, and Day 173 uses cost-per-request for the ROI one-pager.
Unlocks: D147 Observability Complete Β· D157 Monitoring & SLOs Β· D162 The FDE Role