CD9: Monitoring, alerts and scaling

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

What to measure, and how good is good enough

🎯You'll be able to

Choose the signals that describe a service's health, and set service level objectives with an error budget.

🏠The everyday picture

A bus company doesn't judge a route by how shiny the buses are. It asks: did buses come (availability), were they on time (latency), and how many passengers rode (traffic)? It also accepts that one bus in a thousand will be late, and plans around that rather than promising perfection.

📘What it really is

📝A worked example

Input: RouteRani's API exposes /metrics. Run curl -s localhost:8080/metrics | grep -E '^(http_requests_total|http_request_duration_seconds_bucket)' | head.

Expected output: lines such as http_requests_total{method="GET",route="/api/routes",code="200"} 1520 (a counter for each method, route and status code) and http_request_duration_seconds_bucket{...,le="0.05"} 1498 (how many requests finished within 50 ms). These give you Rate and Errors (from the counter) and Duration (from the histogram buckets). An SLI for RouteRani could be "the share of /api/ requests that don't return 5xx", with an SLO of 99.5% over 30 days.

🌍Where it's used

📝Case scenario

A food delivery company's dashboard showed average order-API latency of 150 ms, so the team believed it was fast. Complaints said otherwise. A p99 panel showed 4 seconds during lunch for the slowest 1% of requests, which turned out to be orders with many items. They set an SLO on p99 and fixed the slow query, and complaints dropped.

🖱️Try it

Work out the error budget in minutes for 99.5%, 99.9% and 99.95% over 30 days. Then choose one SLI and SLO for RouteRani's booking endpoint and write why you chose that target. Success: 216, 43.2 and 21.6 minutes, and a target with a reason that isn't "as high as possible".

⚠️Common mistakes

🛠️For your project

Project 3's dashboard shows request rate, failed share and p95, and its alerts are based on errors and p95.

✅Quick check

What do RED's three letters stand for?

Show the answer

Rate, Errors, Duration.

How much failure does a 99.9% SLO over 30 days allow?

Show the answer

About 43 minutes.

← BackCD9
ProLearners Assist