Grafana Cloud Enterprise

Cloudflare alerting

You can use the Cloudflare data source with Grafana Alerting to create alert rules based on your Cloudflare data. This allows you to get notified when DNS query patterns change, response times increase, or other metrics exceed thresholds.

Before you begin

Ensure you have:

Supported query types for alerting

Alerting works best with time series queries that return numeric data. The following Cloudflare query types support alerting:

Query typeUse case
DNS analytics by timeAlert on query count, response times, cache rates
Radar time series queriesAlert on traffic distribution changes

Note

Table-based queries like “DNS analytics report” and “List zones” are not suitable for alerting because they don’t return time series data.

Create an alert rule

To create an alert rule using the Cloudflare data source:

  1. Navigate to Alerting > Alert rules in the left menu.
  2. Click New alert rule.
  3. In the query section, select your Cloudflare data source.
  4. Configure a time series query (for example, DNS analytics by time).
  5. Define your alert condition using expressions (Reduce, Threshold, etc.).
  6. Configure labels, notifications, and other alert settings.
  7. Click Save rule.

For detailed instructions on creating alert rules, refer to Create Grafana-managed alert rules.

Alert examples

Example: Alert on high DNS query volume

To receive an alert when DNS query count exceeds a threshold:

  1. Create a new alert rule.
  2. Select the Cloudflare data source.
  3. Set Action to zones-dns-analytics-report-bytime.
  4. Select your zone from Zone ID.
  5. In Metrics, select Query Count.
  6. Add a Reduce expression to calculate the average or last value.
  7. Add a Threshold expression to trigger when the value exceeds your limit (for example, > 10000).
  8. Configure notification settings and save.

Example: Alert on slow DNS response times

To receive an alert when average DNS response time increases:

  1. Create a new alert rule.
  2. Select the Cloudflare data source.
  3. Set Action to zones-dns-analytics-report-bytime.
  4. Select your zone from Zone ID.
  5. In Metrics, select Average response time.
  6. Add a Reduce expression to calculate the average.
  7. Add a Threshold expression to trigger when response time exceeds your SLA (for example, > 100ms).
  8. Configure notification settings and save.

Example: Alert on DNS query drops

To receive an alert when DNS queries drop significantly (potential outage indicator):

  1. Create a new alert rule.
  2. Select the Cloudflare data source.
  3. Set Action to zones-dns-analytics-report-bytime.
  4. Select your zone from Zone ID.
  5. In Metrics, select Query Count.
  6. Add a Reduce expression to calculate the average.
  7. Add a Threshold expression to trigger when the value drops below a baseline (for example, < 100).
  8. Configure notification settings and save.