Skip to main content
APA
Sponsored by CAST AI — Kubernetes cost optimization Better Stack — Uptime monitoring and log management
⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

Cloudflare Prometheus Alert Rules

2 Prometheus alerting rules for Cloudflare. Exported via lablabs/cloudflare-exporter. These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/cloudflare/lablabs-cloudflare-exporter.yml
warning

9.9.1. Cloudflare http 4xx error rate

Cloudflare high HTTP 4xx error rate (> 5% for domain {{ $labels.zone }})

- alert: CloudflareHttp4xxErrorRate
  expr: (sum by(zone) (rate(cloudflare_zone_requests_status{status=~"^4.."}[15m])) / on (zone) sum by (zone) (rate(cloudflare_zone_requests_status[15m]))) * 100 > 5 and sum by (zone) (rate(cloudflare_zone_requests_status[15m])) > 0
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Cloudflare http 4xx error rate (instance {{ $labels.instance }})
    description: "Cloudflare high HTTP 4xx error rate (> 5% for domain {{ $labels.zone }})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

9.9.2. Cloudflare http 5xx error rate

Cloudflare high HTTP 5xx error rate (> 5% for domain {{ $labels.zone }})

- alert: CloudflareHttp5xxErrorRate
  expr: (sum by (zone) (rate(cloudflare_zone_requests_status{status=~"^5.."}[5m])) / on (zone) sum by (zone) (rate(cloudflare_zone_requests_status[5m]))) * 100 > 5 and sum by (zone) (rate(cloudflare_zone_requests_status[5m])) > 0
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: Cloudflare http 5xx error rate (instance {{ $labels.instance }})
    description: "Cloudflare high HTTP 5xx error rate (> 5% for domain {{ $labels.zone }})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"