Skip to main content

Prometheus Alert Rules Validator

Validate your Prometheus alert rules YAML files. Checks PromQL expression syntax, required fields, severity labels, duration formats, and common mistakes. Paste your rules and get instant feedback.

Frequently Asked Questions

What is Prometheus alerting?▼

Prometheus evaluates alert rules at regular intervals (typically 1m). When a PromQL expression returns results, the alert becomes 'pending'. After the 'for' duration passes, it fires and is sent to Alertmanager, which routes notifications to PagerDuty, Slack, email, etc. Alert rules are defined in YAML files and loaded by Prometheus via the rule_files config.

What is the 'for' clause in alert rules?▼

The 'for' clause specifies how long a condition must be true before the alert fires. Without it, alerts fire immediately (and may flap). Example: 'for: 5m' means the CPU must stay above 80% for 5 continuous minutes. Use it to avoid alerting on brief spikes. Set it to 0s or omit it only for critical alerts where you want instant notification.

How do I write PromQL for CPU usage alerts?▼

CPU usage: 100 - (avg by (instance) (rate(node_cpu_seconds_total{mode='idle'}[5m])) * 100) > 80. Memory: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10. Disk: (node_filesystem_size_bytes - node_filesystem_free_bytes) / node_filesystem_size_bytes * 100 > 85. Use rate() for counters and instant value for gauges.

How do I test alert rules before deploying?▼

Use promtool: promtool check rules /path/to/alerts.yaml. For unit testing, write test files with promtool test rules. In Grafana, use the Alerting > Alert rules page to preview firing alerts. You can also query the Prometheus /api/v1/rules endpoint to see current rule status and use /graph to test PromQL expressions interactively.

What labels and annotations should I include?▼

Required labels: severity (critical/warning/info) for Alertmanager routing, team or service for ownership. Required annotations: summary (one-line description, use {{ $labels.instance }} for dynamic data), description (detailed context including {{ $value }} for the metric value, runbook_url for links to runbooks). These appear in your notification messages.

How do I avoid alert fatigue?▼

Set appropriate 'for' durations (5-15 minutes for non-critical). Use inhibition rules in Alertmanager (e.g. suppress warning when critical fires). Group related alerts. Set proper severity levels and route only critical to PagerDuty. Use dead man's switch alerts for silence detection. Review and tune thresholds regularly — start conservative and tighten based on incident history.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Invalid Date · 11 min read

The Modern DevOps Observability Stack: Grafana, Prometheus, Loki

Build a complete DevOps observability stack with Prometheus for metrics, Loki for logs, Tempo for traces, and Grafana dashboards—includes Docker Compose setup.

Mar 27, 2026 · 15 min read

Grafana vs Datadog vs New Relic vs Prometheus 2026: Observability Platform Comparison

In-depth comparison of the top observability and monitoring platforms for 2026. Metrics, logs, traces, pricing, alerting, dashboards, and APM — pick the right stack for your infrastructure.

Apr 2, 2026 · 11 min read

Microservices Observability with OpenTelemetry 2026: Tracing, Metrics, Logs

Complete guide to implementing observability in microservices using OpenTelemetry in 2026. Distributed tracing, metrics collection, structured logging, and production-ready setup with Jaeger, Prometheus, and Grafana.

Apr 2, 2026 · 11 min read

Monitoring and Alerting in 2026: Modern Practices for System Reliability

A comprehensive guide to monitoring and alerting best practices in 2026, covering Service-Level Objectives, the four golden signals, symptom-based alerting strategies, alert fatigue reduction, and building sustainable on-call practices.

Mar 28, 2026 · 10 min read

OpenTelemetry Observability Guide 2026: Traces, Metrics & Logs

A comprehensive guide to OpenTelemetry in 2026—covering OTel architecture, traces, metrics, logs, Node.js and Python instrumentation, Jaeger, Grafana/Prometheus integration, and production cost-control strategies for backend developers.

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →