SLO Burn Rate Calculator
Calculate SLO burn rate and alert thresholds from error budget consumption data using multi-window multi-burn-rate alerts.
Tested against SLO-math · promtool · claude-code-1.8+
You are an SRE focused on error budgets. Your task is to compute SLO burn rate and produce the thresholds for a multi-window, multi-burn-rate alert set. Context: - You have an SLO target (for example 99.9% of requests 200s over 30 days), a time window, and the error ratio metric. - You will compute numbers and output the alert rules, not modify live state. Steps: 1. Convert the SLO to an error budget allowance: for 99.9% over 30 days, allowed error time is (1 - 0.999) * 30d = 43m 12s, and allowed error budget in request terms is (1 - SLO) * of total traffic. 2. Define the burn-rate windows: choose a fast window (e.g. 1h) and a slow window (e.g. 6h at 14x burn, 30m at 14.4x burn) and a long window that maps to one budget over time. 3. For each window, compute the alert threshold: alert_error_ratio_target = burn_rate * (1 - SLO). For SLO 99.9% and burn 14.4, threshold is 14.4 * 0.001 = 0.0144. 4. Assemble the multi-window rule: a fast burn (14.4x on 1h) for page, a mid burn (6x on 6h) for ticket, and warn-level thresholds at lower burn. 5. Emit rules YAML with the thresholds and the computed budget numbers. Output format: - The computed error budget and burn-rate table. - The complete multi-window Prometheus alerting rules YAML. Constraints: - Use the standard multi-window multi-burn-rate methodology; do not invent the math. - Show the arithmetic so thresholds are auditable. - Only valid PromQL and YAML. Example: Input: SLO 99.99%, 30d window. Output: error budget = (1 - 0.9999) * 30d = 4m 19s; page rule: burn 14.4x on 1h -> threshold 14.4 * 0.0001 = 0.00144; output the multi-window rules.
Why this directive matters
An SLO is only as useful as the alerting wrapped around it, and the reason so many SLO alerts feel wrong is that they use a single instant condition. A system can burn through its entire 30-day budget in a day if a multi-window rule does not catch fast consumption while staying quiet about slow, tolerable burn. This directive implements the standard multi-window, multi-burn-rate method: it converts the SLO into an explicit error-budget allowance, chooses fast, medium, and slow windows, and derives each alert threshold from the budget arithmetic rather than guesswork. It shows the calculation so a reviewer can verify the numbers, then emits the complete Prometheus rule set with page and ticket severities. The result is alerting that fires proportionally to how fast the budget is actually burning.
Test Command
promtool check rules rules-slo.ymlPrerequisites
- An SLO target and window
- Error ratio PromQL available
- Promtool for validation
Expected Outputs
- Error budget + burn-rate table
- Multi-window alert rules YAML
References
- Kubernetes Documentation | Concepts: authoritative concepts for cluster, RBAC, and workload audits.
- Terraform Documentation: plan, state, and provider reference for IaC directives.
- AWS Documentation: IAM, Cost Explorer, and service reference for cloud directives.
- CNCF Landscape: cloud-native tooling context for multi-cloud directives.
Automate it past the prompt.
This advanced directive is a manual, read-only run. Devopsify can run the same check continuously across your estate, with policy gates, approvals, and a retained audit trail.