---
name: "prometheus-recording-rules-slo"
description: "Precompute heavy PromQL expressions and alert on service level objective (SLO) burn rates."
metadata:
  author: "Prometheus"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write prometheus recording rules"
  - "implement multi-burn rate slo alert"
  - "optimize slow promql dashboard"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Prometheus Recording Rules & Multi-Window Multi-Burn SLOs

Authors Prometheus recording and alerting rules: pre-computing rolling rates (job:http_requests:rate5m), implementing Google SRE multi-window multi-burn rate alerts for 99.9% availability SLOs, and reducing dashboard query latencies.

## When to Invoke
Invoke this skill whenever you need to:
- write prometheus recording rules
- implement multi-burn rate slo alert
- optimize slow promql dashboard

## Execution SOP & Rules
1. Define rule groups with name, interval, and rules: - record: job:http_errors:rate5m, expr: sum by(job) (...).
2. Implement burn rate alerts evaluating both short windows (5m, 30m) and long windows (1h, 6h).
3. Reference precomputed rule metrics directly in Grafana panel queries instead of raw counters.
4. Verify rule syntax using promtool check rules /etc/prometheus/rules/*.yml.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
