How do you alert on a latency SLO with burn rates?
AdvancedConceptError Budgets & Burn-Rate Alerting
Answer
Exactly like availability, using the latency "bad" ratio (requests slower than the threshold):
- record: slo:sli_latency_error:ratio_rate1h
labels: {slo: checkout-latency}
expr: |
1 - (
sum(rate(http_request_duration_seconds_bucket{job="checkout",le="0.3"}[1h]))
/
sum(rate(http_request_duration_seconds_count{job="checkout"}[1h]))
)
Then apply the same 14.4/6/3/1 thresholds multiplied by 1 - SLO (for a 99% latency SLO, 14.4 * 0.01).
More on Error Budgets & Burn-Rate Alerting
What is an error budget and how do you calculate it?BeginnerWhat is an error-budget policy?BeginnerWhat happens when the error budget is exhausted? Is it a punishment?IntermediateWhat should you do if the error budget is never spent?IntermediateWhat is burn rate?IntermediateHow much budget does an alert at burn rate B over window W consume?Advanced