> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tell.rs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare

> Monitor DNS, traffic, security, and cache performance from Cloudflare.

Track DNS performance, traffic patterns, cache efficiency, and threat activity over time.

<Info>
  **Category:** Monitoring · **Auth:** API token · **Metrics:** 25
</Info>

## Prerequisites

You need two things from your Cloudflare account:

1. **API Token** — Go to [Cloudflare Dashboard → API Tokens](https://dash.cloudflare.com/profile/api-tokens), create a token with **Zone Analytics:Read** permission.
2. **Zone ID** — Found on the **Overview** tab of your domain in the Cloudflare dashboard.

## Configuration

<Tabs>
  <Tab title="Cloud">
    Go to **Settings → Integrations → Cloudflare** and enter your API token and zone ID.
  </Tab>

  <Tab title="CLI">
    ```toml theme={null}
    [[plugins]]
    name = "cloudflare"
    entity = "all"
    config.api_token = "${CLOUDFLARE_API_TOKEN}"
    config.zone_id = "your-zone-id"
    ```

    Secret values like API tokens can use environment variable references (`${VAR}`).
  </Tab>
</Tabs>

## Entities

Pull everything with `all`, or pick specific categories:

| Entity        | Description                   |
| ------------- | ----------------------------- |
| `dns`         | DNS query analytics           |
| `traffic`     | HTTP traffic metrics          |
| `security`    | Firewall and threat metrics   |
| `performance` | Cache and status code metrics |
| `all`         | All of the above              |

## Metrics

### DNS (8)

| Metric                     | Description                           |
| -------------------------- | ------------------------------------- |
| `dns_queries_total`        | Total DNS queries (24h)               |
| `dns_queries_uncached`     | Uncached DNS queries (24h)            |
| `dns_queries_stale`        | Stale DNS queries (24h)               |
| `dns_response_time_avg`    | Average DNS response time in ms (24h) |
| `dns_response_time_median` | Median DNS response time in ms (24h)  |
| `dns_response_time_p90`    | P90 DNS response time in ms (24h)     |
| `dns_response_time_p99`    | P99 DNS response time in ms (24h)     |
| `dns_queries_nxdomain`     | NXDOMAIN DNS responses (24h)          |

### Traffic (7)

| Metric              | Description                     |
| ------------------- | ------------------------------- |
| `requests_total`    | Total HTTP requests (24h)       |
| `requests_cached`   | Cached HTTP requests (24h)      |
| `requests_uncached` | Uncached HTTP requests (24h)    |
| `bandwidth_total`   | Total bandwidth in bytes (24h)  |
| `bandwidth_cached`  | Cached bandwidth in bytes (24h) |
| `pageviews_total`   | Total page views (24h)          |
| `visitors_unique`   | Unique visitors (24h)           |

### Security (4)

| Metric                | Description                      |
| --------------------- | -------------------------------- |
| `threats_total`       | Total threats detected (24h)     |
| `firewall_events`     | Total firewall events (24h)      |
| `firewall_blocks`     | Firewall block actions (24h)     |
| `firewall_challenges` | Firewall challenge actions (24h) |

### Performance (6)

| Metric                  | Description                               |
| ----------------------- | ----------------------------------------- |
| `cache_hit_ratio`       | Cache hit ratio as percentage (24h)       |
| `bandwidth_saved_ratio` | Bandwidth saved ratio as percentage (24h) |
| `status_2xx`            | 2xx status code count (24h)               |
| `status_3xx`            | 3xx status code count (24h)               |
| `status_4xx`            | 4xx status code count (24h)               |
| `status_5xx`            | 5xx status code count (24h)               |
