CD9: Monitoring, alerts and scaling

Lesson 3 of 5 · reading 15–25 minutes; practice and project time is on the module page

Dashboards that answer questions

🎯You'll be able to

Build a Grafana dashboard from code, with panels that answer "is the service healthy?" at a glance, and provision its data source automatically.

🏠The everyday picture

A car's dashboard shows speed, fuel and warning lights, not the temperature of every bolt. A glance tells you whether to keep driving. Mechanics have deeper tools for when a light comes on.

📘What it really is

📝A worked example

Input: in the finished kit with monitoring on, open http://localhost:3001 (anonymous viewing is on for practice), find "RouteRani: booking API", and run node tools/load.js http://localhost:8080/api/routes 60 5.

Expected output: five panels: "Requests per second (API)" rising to a few hundred, "Failed requests (share of API traffic)" at 0, "p95 response time (API)" in milliseconds, "Copies answering" showing your copy count, and "Version running". Project 3 test 4 checks the dashboard has rate, failed-share and p95 queries, and that Grafana can query Prometheus through the dashboard's data source.

🌍Where it's used

📝Case scenario

During a payments outage, engineers at a fintech company opened eleven different dashboards, each showing something slightly different, and spent 20 minutes agreeing on whether errors were rising. Afterwards, each service got one provisioned "health" dashboard with the same four questions at the top, and incident runbooks linked to it directly.

🖱️Try it

Add a sixth panel to your dashboard JSON: p99 response time, with the same query as p95 but 0.99. Restart Grafana with terraform apply -replace='docker_container.grafana[0]' and check the panel appears. Success: the new panel shows data, and the change is in Git.

⚠️Common mistakes

🛠️For your project

Project 3 test 4 looks for a dashboard with "RouteRani" in its title and rate, 5xx and histogram_quantile queries, with live data.

✅Quick check

Why provision Grafana from files?

Show the answer

So data sources and dashboards are reviewed, versioned and recreated identically.

What four questions should a service's main dashboard answer first?

Show the answer

Is traffic normal, are requests failing, are they slow, is everything running.

← PreviousPrometheus and PromQL
ProLearners Assist