Skip to content

Observability

Prometheus Alert Rule Generator

Expression, threshold, and for-duration, turned into a valid Prometheus alerting rule - the for: clause matters as much as the threshold, since without it a single scrape spike fires and clears before anyone can act.

Expression

groups:
  - name: example
    rules:
      - alert: HighErrorRate
        expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.05
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "Error rate above 5% for 5 minutes"