Prometheus SLO-Based Alerting
How to implement Service Level Objective alerting with Prometheus and reduce alert fatigue.
Alert fatigue kills incident response effectiveness. SLO-based alerting focuses on user-impacting symptoms rather than infrastructure causes.
Defining SLOs
Start with user-facing metrics:
| Service | SLI | SLO Target |
|---|---|---|
| API Gateway | Request success rate | 99.9% |
| Payment Service | Request latency p99 < 500ms | 99.5% |
| Search | Availability | 99.95% |
Recording Rules
Create SLI recording rules in Prometheus:
groups:
- name: slo-recording
rules:
- record: slo:request_success:ratio_rate5m
expr: |
sum(rate(http_requests_total{status!~"5.."}[5m]))
/
sum(rate(http_requests_total[5m]))Multi-Window Burn Rate Alerts
Google's SRE book recommends multi-window, multi-burn-rate alerts:
groups:
- name: slo-alerts
rules:
- alert: HighErrorBudgetBurn
expr: |
slo:request_success:ratio_rate5m < 0.999
and
slo:request_success:ratio_rate1h < 0.999
for: 2m
labels:
severity: critical
annotations:
summary: "High error budget burn rate detected"Burn Rate Windows
Fast burn (5m/1h) for critical pages. Slow burn (6h/3d) for warnings.
Error Budget Policy
Define what happens when error budget is exhausted:
- > 50% remaining — Normal development velocity
- 25-50% remaining — Increase review rigor for risky changes
- < 25% remaining — Freeze non-critical deployments
- Exhausted — All hands on reliability improvements
Conclusion
SLO-based alerting transformed our on-call experience from hundreds of noisy alerts to a handful of actionable pages. Start with one service and expand the pattern gradually.
Related Articles
Trunk-Based Development with Modern CI/CD
Ship faster with short-lived branches, feature flags, and continuous integration on the main trunk.
Docker Multi-Stage Builds in CI/CD Pipelines
Shrink images, speed up pipelines, and improve security with multi-stage Dockerfiles in GitLab CI.
Vercel + GitLab: CI/CD for Next.js Portfolios
Combine GitLab for source control and optional CI checks with Vercel for zero-config Next.js deployment.