Improving your monitoring setup by integrating Cloudflare’s analytics data into Prometheus and Grafana
May 20, 2021Martin Hauskrecht

Summary
This post details the implementation of a custom Prometheus exporter by Labyrinth Labs that pulls data from Cloudflare's GraphQL Analytics API. The exporter transforms Cloudflare analytics data (requests, bandwidth, cache utilization, threats, SSL usage, HTTP response codes, traffic origin by country/location, and data center performance) into Prometheus metrics. It includes design considerations (Go, API SDK, Goroutines for parallel requests), deployment instructions (Docker image, Helm chart for Kubernetes), and visualization guidance using Grafana dashboards. Future work includes integrating more analytics data like firewall, DoS, and network analytics.
More from the Data Infrastructure & Analytics trail
- Introducing Cloudflare Basin: an open, serverless data platform, now generally available
- Introducing the Billable Usage API: programmatic cost visibility for Cloudflare
- Announcing the Monetization Gateway: charge for any resource behind Cloudflare via x402
- How we built Cloudflare's data platform and an AI agent on top of it
- Iran's Internet is partially restored, Cloudflare Radar data shows