Prometheus Alert Rule Generator

List the alerts you want, with optional thresholds, and get a Prometheus rules file with PromQL expressions, severity labels and summaries.

Use the tool

Why this tool exists

Almost every Prometheus setup ends up with the same first alerts: a target that is down, a busy CPU, a full disk, a spike in 5xx responses. The PromQL for each is easy to get slightly wrong, for example a disk query that counts tmpfs or a CPU expression that forgets to average by instance.

This generator holds eight tested-looking patterns and writes them into a rules group with your chosen for: duration and an optional team label. Metric names assume node_exporter, kube-state-metrics, blackbox exporter and a typical http_requests_total counter, so adjust them to what your services export. Use promtool check rules before loading the file.

How to use it

  1. Enter one alert per line, with an optional threshold, such as HighCpu 85.
  2. Set the group name, the for: duration and, if you like, a team label.
  3. Save the output as a rules file, run promtool check rules, then reference it in rule_files.

Frequently asked questions

Which alerts are available?

InstanceDown, HighCpu, HighMemory, DiskLow, High5xxRate, HighLatencyP95, PodCrashLooping and CertExpiry. An unknown name stops with an error listing these.

What do the thresholds mean?

Each alert has its own default: percent for CPU, memory, disk and 5xx, seconds for latency, restarts for crash loops and days for certificate expiry. The number you type replaces that default.

Will the metrics exist in my setup?

Only if you run the matching exporters. The expressions use node_exporter, kube-state-metrics, blackbox and http_requests_total names. Rename metrics to match your own instrumentation.

Does it check the PromQL?

No. It only fills in the templates. Run promtool check rules on the file to catch syntax problems.