agentleFS
kryptophonikkryptophonik/SRE-Skills/.claude/skills/sre-slo-burn-rate-rules/SKILL.md

sre-slo-burn-rate-rules

Skill4 starsChanged 25 days agoMITView on GitHub

Use when authoring or fixing Prometheus SLO burn-rate alert rules: generate 4-tier multiwindow rules from an SLO target and counters, then promtool lint and test. Files only, never deploys. Not for responding to a firing alert (use sre-engineer).

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.

    line 14
  2. Distinctive:

    If the script warns "can never fire", tell the user.

    line 31
  3. Very specific:

    Stop. Changing a live Prometheus or rule repo goes through Git/CI with approval (sre-safety-gates).

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SLO burn-rate rules

For authoring rule files only. Not for responding to a firing alert: that is sre-engineer, using Responding to a firing burn-rate alert in sre-slo-alerting. Don't generate or test rules during an incident.

Safety gates (REQUIRED)

  1. Read-only diagnosis first.
  2. Propose each change with risk (low/med/high) and reversibility.
  3. Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
  4. Act only as approved, verify, and stop and escalate if anything gets worse.

Full rules: sre-safety-gates. Process and policy: sre-slo-alerting. Script and references: sre-prometheus-grafana.

Requires sre-prometheus-grafana installed alongside (sibling folder).

Steps

  1. Get from the user, or ask: SLO name, objective (a ratio such as 0.999), the bad-events counter selector, the all-events counter selector, the labels to keep (default job), and the SLO period (default 30d). Check that the metric and label names exist (promtool query series "$PROM_URL" --match='<selector>'), and don't guess code vs status.
  2. Generate:
    python3 ../sre-prometheus-grafana/scripts/gen-burn-rate-rules.py \
      --slo-name <name> --objective <0.999> \
      --errors '<metric>{job="<svc>",code=~"5.."}' --total '<metric>{job="<svc>"}' \
      --by job --runbook-url 'https://runbooks.example.com/slo/<slo-name>' --out slo-<name>.rules.yml
    If the script warns "can never fire", tell the user. With objectives of 99% or lower, the 14.4x tier can't trigger (SRE Workbook, "Extreme Availability Goals").
  3. Validate: promtool check rules --lint=all --lint-fatal slo-<name>.rules.yml.
  4. Unit-test: copy slo-burn-rate.test.yml. Point rule_files at the new file and set the series names, labels, slo value and annotations to match, then run promtool test rules <test>.yml. Keep all 7 scenarios: healthy, fast burn, slow burn, reset, 3d tier, 1h tier only, 6h tier only.
  5. Output the rule file, the test file, both promtool results, and the alert routing note: the page alert is severity=page and the ticket alert is severity=ticket, both labelled slo. Inhibit the ticket while the page fires (equal: [slo]).
  6. Stop. Changing a live Prometheus or rule repo goes through Git/CI with approval (sre-safety-gates). Never call /-/reload.

Output

  • Rule file, test file, promtool check and promtool test results, routing/inhibition note

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.