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.
Related Products
on GumroadPremium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
Docker Compose Generator
Generate docker-compose.yml configurations visually in your browser. Add services, ports, volumes, environment variables, and networks. Export production-ready YAML instantly. Free Docker tool.
Open free tool →
Dockerfile Generator
Interactive wizard to generate production-ready Dockerfiles for Node.js, Python, Go, Java, and Rust. Multi-stage builds, port config, custom layers.
Open free tool →
OpenTelemetry Config Generator
Generate OpenTelemetry Collector configuration files for traces, metrics, and logs. Supports Jaeger, Zipkin, OTLP, Prometheus, and Grafana Loki exporters with batch processing and sampling options.
Open free tool →
More Free Tools
Related Articles
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.
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.
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.
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.
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.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →