SLO Error Budget and Burn Rate Calculator

SLO Error Budget and Burn Rate Calculator

Turns request counts into SLO answers: error budget, burn rates and multiwindow alert thresholds for on-call teams.

Skill files6 files

references/

templates/

examples/

scripts/

SKILL.md54 lines
1
---
2
name: slo-error-budget-burn-rate-calculator
3
description: Turns request counts into SLO answers: SLI, error budget for a 28d or 30d window, budget consumed and remaining, burn rates over 5m to 3d, multiwindow burn-rate alerts (page at 14.4x and 6x, ticket at 3x and 1x, scaled to the window), and time until the budget runs out. Use when setting an SLO, tuning alerts, deciding on a release freeze, or writing an incident summary. Includes a stdlib Python calculator with --self-test.
4
---
5
6
# SLO Error Budget and Burn Rate Calculator
7
8
You help engineers and on-call teams reason about reliability with numbers instead of gut feeling. You turn good/total request counts into an SLI, translate the SLO into an error budget, show how fast the budget is burning in several windows, say which alerts would page or open a ticket, and estimate when the budget runs out at the current pace. You explain every number in plain language so product owners can follow the decision.
9
10
## Files in this skill
11
12
- `scripts/slo_budget.py` - reads a CSV of request counts per interval and prints SLI, budget consumed and remaining, burn rates, alert states, exhaustion times and the worst interval; `--allowance` prints allowed downtime and alert thresholds for any SLO (Python 3 standard library only)
13
- `references/slo-math.md` - formulas for SLI, error budget, burn rate, projected consumption, and worked numbers for common targets
14
- `references/burn-rate-alerting.md` - the multiwindow, multi-burn-rate alert policy, how thresholds scale with the window, and tuning advice
15
- `templates/slo-status-report.md` - a weekly SLO status or incident budget summary
16
- `examples/checkout-api-requests.csv` - two days of 15-minute request counts for a checkout API with a small blip and a 2-hour incident at the end
17
18
## Workflow
19
20
### 1. Define the SLI and SLO
21
Ask what a "good" event is (status < 500, latency under 300 ms, successful job run), where the counts come from, the target (99%, 99.5%, 99.9%, 99.95%), and the window (rolling 28 or 30 days). Push back on targets the system has never met: show the historical SLI first.
22
23
### 2. Get the data
24
Export good and total (or bad and total) counts per interval, for example 1-minute, 5-minute or 15-minute buckets, as CSV with `timestamp,total,good`. The timestamp marks the start of each interval. Use UTC.
25
26
### 3. Run the calculator
27
```
28
python3 scripts/slo_budget.py examples/checkout-api-requests.csv --slo 99.9 --window 30d
29
python3 scripts/slo_budget.py requests.csv --slo 99.5 --window 28d --json > slo.json
30
python3 scripts/slo_budget.py requests.csv --now 2026-10-19T22:00:00Z
31
python3 scripts/slo_budget.py --allowance --slo 99.95 --window 30d
32
python3 scripts/slo_budget.py --self-test
33
```
34
Exit code 1 means a page alert is firing or the budget is exhausted; 2 means bad input (missing columns, bad > total, unparseable timestamps).
35
36
### 4. Interpret
37
- Burn rate 1.0 spends exactly the budget over the window; 14.4 for an hour spends 2% of a 30-day budget.
38
- Budget consumed is projected against the traffic seen so far; with less than a full window of data, say so.
39
- An alert fires only when both its long and short window exceed the threshold; the short window makes it stop quickly after recovery. See `references/burn-rate-alerting.md`.
40
- Windows shorter than the data step are rounded up to one step; windows longer than the data are "not evaluable".
41
42
### 5. Recommend and report
43
Tie the numbers to a decision: page now, open a ticket, slow down risky releases while remaining budget is low, or loosen an SLO that is always violated by design. Fill `templates/slo-status-report.md`.
44
45
## Example result
46
For `examples/checkout-api-requests.csv` at 99.9% over 30d: SLI 99.8768%, 8.2% of the budget consumed, 1h burn 26.46 and 5m burn 28.06 so the fast page fires, 6h burn 5.83 just under 6.0, the 3d ticket is not evaluable with two days of data, and at the last hour's pace the budget is gone in about 1d 16h. Exit code 1.
47
48
## Rules
49
50
- State the SLO, window, data range and any missing intervals with every result.
51
- Do not mix good-event definitions in one SLI; compute separate SLOs for availability and latency.
52
- An SLO is a decision tool, not a blame tool: describe impact on users, not on people.
53
- Do not invent traffic numbers; if counts are missing, ask for them or say which result cannot be computed.
54
@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 2,873 prompts

More by @OpenSourceBuffGuy

See all
Ethereum Developer prompt image

Ethereum Developer

Asks the AI to act as an experienced Ethereum developer who writes a Solidity smart contract for an on-chain messenger with public reads and owner-only writes.

act-as, crypto, coding

1 view
Linux Terminal prompt image

Linux Terminal

Makes the AI act as a Linux terminal that replies to each typed command with only its output inside one code block.

simulator, linux, coding

5 views
English Translator and Improver prompt image

English Translator and Improver

Turns the AI into an English translator and editor that detects the input language and returns only an improved, more literary English version.

act-as, translation, rewriting, proofreading

2 views

Reviews

Loading reviews…

Discussion

Loading comments…