What is the problem with computing a 30-day ratio as `avg_over_time` of a 5-minute ratio?
AdvancedConceptError Budgets & Burn-Rate Alerting
Answer
avg_over_time(slo:sli_error:ratio_rate5m[30d]) weighs every 5-minute window equally regardless of traffic, so it becomes a time-based SLI. A 5-minute outage at 3 AM with 10 requests counts as much as one at peak with 100,000. For a request-based SLO, compute the ratio of sums instead:
sum(increase(http_requests_total{job="checkout",code=~"5.."}[30d]))
/
sum(increase(http_requests_total{job="checkout"}[30d]))
or record per-window error and total counts separately and divide the sums.
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