Dashboards, alerts and SLI/SLO for a QA
Alerts are set on user-facing symptoms such as error rate or latency, while SLI, SLO and error budget give a shared language for reliability. An SLI is a measurable indicator, an SLO is a target for it over a period, and an SLA is an external promise. The error budget is 100% minus the SLO: for 99.9% over 30 days that is about 43 minutes. A useful alert has a runbook.
Logs · SLO and alerts
An alert rings every night about CPU, and a real payment failure woke nobody. What is wrong?
A team set an alert "CPU above 80%". It fires every night during backup, and people learned to ignore it. When payment really stopped working for 5% of users while CPU was normal, there was no notification. This is the classic story of "alert fatigue" and of alerts on causes instead of symptoms. This lesson covers how to read a dashboard, which alert is useful, and how SLI/SLO give a shared language between testing, development and business.
How it works and why. A dashboard shows the state on one screen: error share, p95 latency, traffic, queues. A good dashboard answers "is everything fine?" in seconds and leads deeper (drill-down) to a chart of a specific service, then to traces and logs. An alert is an automatic notification when a condition holds for some time. The principles:
- Alert on symptoms for the user (error share, latency), not on every internal detail. High CPU on its own does no harm if requests complete in time.
- Every alert is actionable: someone knows what to do (a runbook). Noisy alerts get ignored.
- A condition with a duration (
for: 10m) so it does not fire on a one-second spike. - Percentiles (p95, p99), not the average: an average hides the slow "tail".
Two alerts for one problem
CPU above 80%
A cause, not a consequence for the user. Fires every night, no runbook. A real payment failure does not touch it.
5xx above 2% for over 10 min
A symptom: users see errors. It has a duration and a runbook link.
SLI / SLO / SLA. SLI (indicator) is a measurable quality figure: the share of successful requests, the share of responses faster than 300 ms. SLO (objective) is a target for an SLI over a period: "99.9% of requests succeed over 30 days". SLA is an external contractual promise with consequences for breaking it, usually looser than the internal SLO. The error budget is the allowed share of failures: 100% minus the SLO. While the budget is not spent, the team can ship changes fast; once spent, reliability comes first. The budget in time for a 30-day period:
| SLO | Budget over 30 days |
|---|---|
| 99% | 7.2 hours |
| 99.9% | 43.2 minutes |
| 99.99% | 4.32 minutes |
Example: a symptom alert and checking it. A rule for Prometheus (metric names are illustrative):
groups:
- name: checkout
rules:
- alert: CheckoutHighErrorRate
expr: |
sum(rate(http_requests_total{service="checkout",status=~"5.."}[5m]))
/ sum(rate(http_requests_total{service="checkout"}[5m])) > 0.02
for: 10m # do not fire on a short spike
labels:
severity: page
annotations:
summary: "The 5xx share in checkout has been above 2% for 10 minutes"
runbook_url: https://wiki.example.com/runbooks/checkout-5xx
What remains is to check that the rule works. A tester in a test environment induces a failure artificially (fault injection: a gateway mock configured to return 500 for 5% of requests), waits over 10 minutes and checks that the alert goes into the firing state and the notification reaches the right channel with a runbook link. Then restores the service and checks that the alert resolves. Without such a check, a rule can for years point at a metric that no longer exists and stay silent.
Limits and alternatives. A fixed threshold (2%) does not account for how fast the budget is being spent. Mature teams alert on the speed of budget "burn" (burn rate) over several windows: fast burn wakes a person, slow burn creates a task. For low traffic the share is unstable: one failure out of ten requests is 10%. So they add a minimum request volume or look at longer windows. Synthetic checks (a script regularly walks a key scenario in production) catch failures when traffic is low, for example at night.
Where QA fits. Checks that key scenarios are covered by metrics and alerts; that an alert really fires on an injected failure; that the runbook is current. SLOs are used as a release criterion: a canary release with a rollback if a metric is worse than the threshold. And a dashboard is used to assess the effect of a release without waiting for complaints.
Typical mistakes.
- An alert on a cause (CPU, memory) instead of a symptom: noise and missed real failures.
- An alert without a runbook: the recipient does not know what to do.
- An SLO of 100%: a zero budget, no changes. The target must be reachable.
- Not testing alerts: a rule may have broken when a metric was renamed.
Check yourself
An SLO of 99.9% over 30 days. One outage lasted 50 minutes. Is the budget spent?
Answer
Yes. A 0.1% budget of 30 days is about 43.2 minutes, and the outage lasted longer. This assumes the SLI counts downtime; if the SLI is a share of requests, an outage on part of the traffic spends the budget more slowly. After exhaustion reliability comes first: fewer risky releases, root-cause analysis.
Why is an alert on p95 latency better than one on average latency?
Answer
The average is diluted by fast responses: five percent of very slow requests barely move it, though every twentieth user waits. p95 shows the threshold exceeded by 5% of requests, so this "tail" is visible and can be alerted on.