Prometheus Alert Rule Builder
Build Prometheus alerting rules — groups, alerts, expressions, durations, labels, and annotations.
Group
Rule 1
rules.yml
groups:
- name: service-alerts
rules:
- alert: HighRequestLatency
expr: rate(http_request_duration_seconds_sum[5m]) > 0.5
for: 10m
labels:
severity: warning
annotations:
summary: "High request latency on {{ $labels.instance }}"
description: "Average request latency is above 0.5s for the last 10 minutes."
Examples
High latency alert
alert HighRequestLatency
expr rate(http_request_duration_seconds_sum[5m]) > 0.5
for 10m, severity warninggroups:
- name: service-alerts
rules:
- alert: HighRequestLatency
expr: rate(http_request_duration_seconds_sum[5m]) > 0.5
for: 10m
labels:
severity: warningAn alert fires when the 5-minute average latency stays above 0.5s for 10 minutes.
About this tool
The Prometheus Alert Rule Builder writes an alerting rules YAML. Set a group name and add rules — each with an alert name, a PromQL expression, a for duration, a severity label, and summary/description annotations. The output is a rules file you load into Prometheus — nothing is uploaded.
How to use
Name the group
Group related alerts under one name for organisation.
Add rules
Each rule needs an expression; for, severity, and annotations make it useful.
Load into Prometheus
Reference the file from rule_files and reload Prometheus.
Use cases
Service SLOs
Turn latency or error-rate SLOs into concrete alerting rules.
Common mistakes
Mistake:Forgetting the for duration.
Fix:Without a for, a single scrape spike pages you immediately; add a duration to smooth noise.
Frequently asked questions
Related guides
References & standards
Related tools
Reverse DNS (PTR) Lookup
Perform reverse DNS lookups for IPv4 and IPv6 addresses using DNS-over-HTTPS
MX Record Lookup
Inspect MX (Mail Exchanger) records, priority preferences, and email provider detection
TXT Record & SPF/DKIM Checker
Query TXT records and analyze SPF, DKIM, and DMARC email authentication security policies
NS Record Lookup
Inspect Name Server (NS) DNS records and authoritative DNS provider configurations
GitLab CI Generator
Generate a .gitlab-ci.yml from stages and jobs — images, scripts, artifacts, and branch rules
Jenkins Pipeline Builder
Build a declarative Jenkinsfile — agent, environment, stages with shell steps, and post actions