Explore documentation
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.
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_TOKENsecret and paste in the created token value. - Add
BASIC_AUTH_USERandBASIC_AUTH_PASSWORDsecrets with credentials of your choice.
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:
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.
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! 🙏