agentleFS
kryptophonikkryptophonik/SRE-Skills/.claude/skills/sre-slo-alerting/SKILL.md

sre-slo-alerting

Skill4 starsChanged 24 days agoMITView on GitHub

Use when creating or revising SLIs, SLOs, error budget policy, burn-rate alerts or paging policy, and for alert-fatigue reduction. Not for responding to a firing alert (use sre-engineer).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    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 12
  2. Distinctive:

    Write the error budget policy.

    line 23
  3. Distinctive:

    Use rolling windows (28 or 30 days) to avoid 'reset' effects at month end.

    line 84
  4. Distinctive:

    Don't aim for 100%; leave room for innovation and failure.

    line 85
  5. Distinctive:

    Ensure both developers and SREs agree on the consequences of a budget depletion.

    line 86
  6. Distinctive:

    No alert without action: If you don't know what to do when an alert fires, don't create it.

    line 99
  7. Very specific:

    Read-only checks (example for a 99.9% SLO with rules from sre-prometheus-grafana's gen-burn-rate-rules.py, which fire …

    line 134
  8. Distinctive:

    Slow or very slow burn (ticket): not an emergency. Find which route, dependency, retry pattern or gradual latency regression is spending …

    line 151

≈ “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

SLOs and Alerting

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. Read-only MCP setup: sre-safety-gates/references/mcp.md.

One flow: pick SLIs -> set SLOs -> error budget policy -> burn-rate alerts -> prune noise.

Workflow

  1. Choose SLIs with the selection guide (Part 1).
  2. Fill the SLO template; agree targets and windows with the service owner.
  3. Write the error budget policy.
  4. Derive burn-rate alerts (Part 2) from the SLO; every alert links to a runbook (sre-runbook-templates).
  5. Review existing alerts; remove or merge those without an action.
  6. Propose rule changes; apply to live systems only after approval (sre-safety-gates).

Part 1 — SLOs

SLI selection guide

Request driven

  • Availability: Proportion of valid requests that were successful.
  • Latency: Proportion of valid requests that were faster than a threshold.
  • Quality: Proportion of valid requests that were served without degradation.

Pipeline driven

  • Freshness: Proportion of data that was updated recently.
  • Correctness: Proportion of data that passed validation.
  • Coverage: Proportion of total data that was processed.

Storage driven

  • Durability: Proportion of data that was not lost.
  • Throughput: Proportion of time throughput was above threshold.

SLO markdown template

# SLO: [Service Name] - [Objective Name]

## 1. Goal
State the purpose of this SLO (e.g., "Ensure checkout is available and fast for users").

## 2. SLI Definition
- **Metric Source:** [e.g., Prometheus http_requests_total]
- **Numerator:** [e.g., requests with status < 500]
- **Denominator:** [e.g., all valid requests]
- **Measurement Window:** [e.g., rolling 28 days]

## 3. SLO Target
- **Availability Target:** [e.g., 99.9%]
- **Latency Target:** [e.g., 95% < 300ms]

## 4. Error Budget Policy
- **Alerting Thresholds:**
  - Page: [e.g., 2% budget burn in 1h]
  - Ticket: [e.g., 10% budget burn in 24h]
- **Action Policy:**
  - If budget >= 25%: Feature development continues.
  - If budget is between 0% and 25%: Heightened review of all changes.
  - If budget <= 0%: Freeze feature releases, focus on reliability.

## 5. Exclusions
- [e.g., Load testing traffic]
- [e.g., Third-party outages out of our control]

Error budget best practices

  • Use rolling windows (28 or 30 days) to avoid 'reset' effects at month end.
  • Don't aim for 100%; leave room for innovation and failure.
  • Ensure both developers and SREs agree on the consequences of a budget depletion.
  • Automate the measurement; manual SLOs are never accurate.

Part 2 — Alerting

Alerting principles

Symptom vs cause

  • Symptom: The service is slow (alert on this)
  • Cause: The database has high CPU (investigate this after the symptom alert)

No alert without action: If you don't know what to do when an alert fires, don't create it.

Pager vs ticket

  • Pager: Requires immediate human intervention (user impact occurring now).
  • Ticket: Needs attention within business hours (potential future impact).

Burn rate strategies (multiwindow, multi-burn-rate)

Alert only when both the long and the short window exceed N * (1 - <slo>). The short window confirms the burn is still happening.

TierBurn rateLong / short windowBudget used (30d)Action
Fast14.4x1h / 5m2% in 1hPage
Medium6x6h / 30m5% in 6hPage
Slow3x1d / 2h10% in 1dTicket
Very slow1x3d / 6h10% in 3dTicket
  • Build the 1d and 3d windows from recording rules, not raw queries.
  • for: is only a noise filter; for: 0m is valid because the short window already de-noises.
  • Full Prometheus rule file (promtool-validated): sre-prometheus-grafana; generate your own with /sre-slo-burn-rate-rules.

Responding to a firing burn-rate alert (reference)

Reference for sre-engineer when a burn-rate alert fires; designing the alerts stays above. Source: Google SRE Workbook, Alerting on SLOs (Tables 5-4, 5-6 and 5-8).

Burn rate is how fast the error budget is being spent relative to the SLO: 1x spends exactly the whole budget over the SLO period. Time to exhaust the whole budget = period / burn rate. With part of the budget already spent: remaining fraction x period / burn rate.

AlertBurn rate (long / short window)Budget spent when it fires (30d)Whole budget gone in (30d)What it meansResponse
Fast burn14.4x (1h / 5m)2%about 2 days (50 h)Something broke recently and is still brokenPage: respond now
Medium burn6x (6h / 30m)5%5 daysSignificant sustained errorsPage: respond now
Slow burn3x (1d / 2h)10%10 daysChronic degradationTicket: next business day
Very slow burn1x (3d / 6h)10%30 daysOn track to spend exactly the budgetTicket

Read-only checks (example for a 99.9% SLO with rules from sre-prometheus-grafana's gen-burn-rate-rules.py, which fire SLOErrorBudgetBurnFast / SLOErrorBudgetBurnSlow; use your SLO name):

# current burn rate; above the tier's threshold = still burning
slo:sli_error:ratio_rate5m{slo="<slo>"} / (1 - 0.999)   # short window
slo:sli_error:ratio_rate1h{slo="<slo>"} / (1 - 0.999)   # long window

Fast or medium burn (page), first 15 minutes:

  1. Is it still burning? If the short-window burn rate is back under the threshold, the spike has passed: record it and keep watching instead of mitigating.
  2. Is it real? Check request volume. On a low-traffic service a handful of errors can be a 1,000x burn rate (Workbook, "Low-Traffic Services").
  3. Scope: which route, status code, region, zone or version is failing (use sre-diagnostics and your observability adapter).
  4. What changed in the last 1-2 hours: deploys, feature flags, config, infrastructure, dependencies.
  5. Mitigate before root cause: propose a rollback or flag-off with risk and reversibility from sre-remediation-actions, and wait for approval.
  6. Compute the remaining budget and time to exhaustion and put both in the incident notes.

Slow or very slow burn (ticket): not an emergency. Find which route, dependency, retry pattern or gradual latency regression is spending budget, forecast the date the budget runs out, and file it with the owning team. Apply the error budget policy above.

Escalate: for a fast or medium burn with confirmed user impact, get an Incident Commander (sre-incident-command). Escalate to the service owner if it isn't mitigated within 30 minutes, if the remaining budget falls below 25% (the same line as the error budget policy above), or if the budget is spent (the error budget policy applies). Escalate a slow burn when a page tier fires as well or the budget forecast runs out before the period ends. The 30-minute and 25% lines are this pack's defaults, not Workbook values; set your own in your error budget policy.

Alert definition template

# Alert: [Service] error budget burn

## 1. Description
SLO [<slo>, e.g. 99.9%] over [30d] is burning budget. Impact: [user-facing symptom].

## 2. Trigger Conditions (all four tiers; threshold = N * (1 - <slo>))
- **Page:** (ratio_1h > 14.4*(1-<slo>) AND ratio_5m > 14.4*(1-<slo>))
        OR (ratio_6h > 6*(1-<slo>) AND ratio_30m > 6*(1-<slo>))
- **Ticket:** (ratio_1d > 3*(1-<slo>) AND ratio_2h > 3*(1-<slo>))
        OR (ratio_3d > 1*(1-<slo>) AND ratio_6h > 1*(1-<slo>))
- **Ratios:** recording rules `slo:sli_error:ratio_rate<window>` with `slo="<slo>"` (from `gen-burn-rate-rules.py`)
- **for:** none (the generator default), or a short noise filter only

## 3. Runbook Link
[Link to sre-runbook-templates output]

## 4. Troubleshooting Steps
1. Check dependency [X]
2. Verify deployment [Y]
3. Look for logs matching [Z]

Alert reduction techniques

  • Inhibit: Silence dependent alerts when the root cause is already alerting.
  • Group: Batch similar alerts together (e.g., by service or region).
  • Deduplicate: Ensure multiple paths to the same alert are merged.
  • Tune: For latency, use histogram percentiles (p95/p99) rather than averages.

Output

  • Completed SLO document: SLIs with queries, targets, windows, error budget policy, owners
  • Alert definitions (query, threshold, burn-rate windows, severity, runbook link) and list of alerts to remove/merge

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.