Video in progress

Strong Middle 🧩 Microservices

What are SLI, SLO and error budget, and how do you tie alerts to them?

An SLI is a measurable indicator (for example, the share of successful requests faster than 500 ms), an SLO is the target set for it (99.9% over 30 days), and the error budget is the failure you are still allowed (0.1%). I alert on how fast the budget is burning, not on CPU or a single error.

📖 Answer

Pick the SLI from the user's point of view. "CPU is at 80%" tells a user nothing. "What share of checkout requests finished in under 1 second without an error" does.

SLI    = good requests / all requests
SLO    = 99.9% over a 30-day window
Budget = 0.1% → about 43 minutes of full outage per month, or an equivalent amount of errors

The error budget is a decision-making tool. When plenty of budget is left, the team ships fast and experiments. When the budget runs out, new features stop and time goes to reliability. The "we should be more careful" argument turns into a number.

Alerts use burn rate: how many times faster than normal the budget is being spent:

# over a 1-hour window the error share is 14.4 times what the SLO allows
(
  sum(rate(http_server_requests_seconds_count{status=~"5.."}[1h]))
  / sum(rate(http_server_requests_seconds_count[1h]))
) > (14.4 * 0.001)

At 14.4 times the rate, 2% of the 30-day budget burns in one hour, which is worth waking someone up immediately. For slower burn (say 3 times the rate over 6 hours) a ticket handled during working hours is enough. An alert that checks a short and a long window together cuts down false alarms.

Common mistakes: setting the SLO to 99.99% (4 minutes per month, and one bad deploy eats it), a single SLO for all endpoints, and promising yourself a higher SLO than your downstream's SLO. Availability of chained dependencies multiplies: 99.9% × 99.9% × 99.9% ≈ 99.7%.