This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopshigh PriorityID: prometheus-recording-rules-alerting

Prometheus Multi-Window Multi-Burn-Rate Error Budget Alerting Standard

Site Reliability Engineering (SRE) standard for Prometheus and OpenTelemetry. Mandates implementing Google SRE Multi-Window Multi-Burn-Rate alerting rules on Service Level Objectives (SLOs), eliminating alert fatigue caused by single-spike threshold alerts and capturing both fast and slow burn budget exhaustions.

Prohibited Anti-Pattern: AI creates naive CPU > 80% or error_rate > 1% alerts, causing dozens of false-alarm pages every day and masking gradual catastrophic service degradations.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Prometheus Multi-Window Multi-Burn-Rate Error Budget Alerting Standard - Site Reliability Engineering (SRE) standard for Prometheus and OpenTelemetry. Mandates implementing Google SRE Multi-Window Multi-Burn-Rate alerting rules on Service Level Objectives (SLOs), eliminating alert fatigue caused by single-spike threshold alerts and capturing both fast and slow burn budget exhaustions.
globs: **/prometheus*.yaml, **/alerts/*.yaml, **/rules/*.yaml
alwaysApply: false
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/prometheus-recording-rules-alerting"
---

# Prometheus Multi-Window Multi-Burn-Rate Error Budget Alerting Standard

> **Severity**: HIGH | **Category**: devops
> **Anti-Pattern Warning**: AI creates naive CPU > 80% or error_rate > 1% alerts, causing dozens of false-alarm pages every day and masking gradual catastrophic service degradations.

## System Constraints
You are a Site Reliability Engineer (SRE) specializing in Prometheus and SLO-based alerting. DO NOT write static threshold alerts (e.g. cpu > 90%). Static alerts cause severe alert fatigue. Implement Multi-Window Multi-Burn-Rate alerts comparing 1-hour and 6-hour windows against your 99.9% error budget consumption.

## Strict Guidelines
- MUST precalculate error ratios using Prometheus recording rules (job:http_requests_total:rate5m).
- MUST require both a short window (e.g. 5m / 1h) and long window (e.g. 30m / 6h) condition to fire alerts (eliminates transient reset spikes).
- MUST define alert severity based on burn rate (14.4x burn rate = Page / P1; 6x burn rate = Ticket / P2).
- MUST include runbook_url and dashboard_url in alert annotations.
- MUST NOT page on-call engineers for self-healing transient errors lasting under 5 minutes.

## Bad vs Good Implementations
### Multi-Window Multi-Burn-Rate SLO Alert in Prometheus

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Single-window threshold alerts fire constantly on transient background jobs or pod restarts, causing engineers to ignore alerting notifications entirely.
```yaml
# FATAL: Naive threshold alert causing alert fatigue
- alert: HighErrorRate
  expr: rate(http_requests_total{status=~"5.."}[1m]) > 0.01
  for: 1m
  # Fires on every temporary 30-second restart or network blip!
```

#### Production Standard (Correct)
> **Standard**: Correlates a short window (5m) and long window (1h) against the 14.4x error budget burn rate. Alerts only when genuine systematic service failure consumes significant budget.
```yaml
groups:
  - name: slo_alerts
    rules:
      # 1. Recording rule for error ratio
      - record: job:http_errors:rate5m
        expr: sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m]))

      # 2. Multi-Window Multi-Burn-Rate: 14.4x burn rate (2% budget consumed in 1 hour)
      - alert: HighErrorBudgetBurnRate
        expr: (
            job:http_errors:rate5m > (14.4 * 0.001) and
            job:http_errors:rate1h > (14.4 * 0.001)
          )
        for: 2m
        labels:
          severity: page
        annotations:
          summary: "High error budget consumption rate (14.4x burn rate)"
          runbook_url: "https://wiki.internal/runbooks/api-error-budget"
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Prometheus Multi-Window Multi-Burn-Rate Error Budget Alerting Standard

Prometheus Multi-Window Multi-Burn-Rate Error Budget Alerting Standard defines an industrial-grade behavioral standard for devops engineering. Site Reliability Engineering (SRE) standard for Prometheus and OpenTelemetry. Mandates implementing Google SRE Multi-Window Multi-Burn-Rate alerting rules on Service Level Objectives (SLOs), eliminating alert fatigue caused by single-spike threshold alerts and capturing both fast and slow burn budget exhaustions. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: AI creates naive CPU > 80% or error_rate > 1% alerts, causing dozens of false-alarm pages every day and masking gradual catastrophic service degradations. Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftAI creates naive CPU > 80% or error_rate > 1% alerts, causing dozens of false-alarm pages every day and masking gradual catastrophic service degradations.High
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

MUST precalculate error ratios using Prometheus recording rules (job

MUST precalculate error ratios using Prometheus recording rules (job:http_requests_total:rate5m).

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

MUST require both a short window (e.g. 5m / 1h) and long window (e.g. 30m / 6h) condition to fire alerts (eliminates transient reset spikes).

MUST require both a short window (e.g. 5m / 1h) and long window (e.g. 30m / 6h) condition to fire alerts (eliminates transient reset spikes).

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

MUST define alert severity based on burn rate (14.4x burn rate = Page / P1

MUST define alert severity based on burn rate (14.4x burn rate = Page / P1; 6x burn rate = Ticket / P2).

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

MUST include runbook_url and dashboard_url in alert annotations.

MUST include runbook_url and dashboard_url in alert annotations.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

MUST NOT page on-call engineers for self-healing transient errors lasting under 5 minutes.

MUST NOT page on-call engineers for self-healing transient errors lasting under 5 minutes.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Prometheus Multi-Window Multi-Burn-Rate Error Budget Alerting Standard critical for AI coding assistants?

Site Reliability Engineering (SRE) standard for Prometheus and OpenTelemetry. Mandates implementing Google SRE Multi-Window Multi-Burn-Rate alerting rules on Service Level Objectives (SLOs), eliminating alert fatigue caused by single-spike threshold alerts and capturing both fast and slow burn budget exhaustions. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (AI creates naive CPU > 80% or error_rate > 1% alerts, causing dozens of false-alarm pages every day and masking gradual catastrophic service degradations.) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Prometheus