Cloudflare Prometheus Exporter

Get Cloudflare dashboard in 3 minutes

Visualize requests, errors, durations, workers, caching, and more in Better Stack using the Cloudflare Prometheus Exporter.

Get Cloudflare metrics

Create an exporter Worker, set up a token and secrets.

1. Deploy exporter

Deploy the exporter to Cloudflare: One-click deploy to Cloudflare

2. Create Cloudflare token

Create a Cloudflare token with the necessary permissions: One-click create token with pre-filled permissions

You should see the permissions as listed below. Create the token and copy its value for later.

Cloudflare API token permissions

3. Add Worker secrets

Navigate to your Worker in Cloudflare -> Settings.

Enter the API token and basic auth under Variables and Secrets:

  • Add the CLOUDFLARE_API_TOKEN secret and paste in the created token value.
  • Add BASIC_AUTH_USER and BASIC_AUTH_PASSWORD secrets with credentials of your choice.

Add Cloudflare secrets

Finish the setup in Better Stack

Create a source, add the Worker URL and HTTP authentication.

1. Create source

Create source of type Prometheus scrape in Better Stack.

2. Add Worker URL

Fill in URLs to scrape. Use the Worker URL followed by /metrics:

Example URL
https://cloudflare-prometheus-exporter.your-domain.workers.dev/metrics

3. Use HTTP authentication

Navigate to Advanced settings and enter the HTTP authentication credentials. Use the BASIC_AUTH_USER and BASIC_AUTH_PASSWORD secret values.

Fill in basic auth in Better Stack

Visit the dashboard

Check out your Cloudflare data and analytics in a pre-made Cloudflare Prometheus Exporter dashboard.

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! 🙏