The project drives metrics from the CloudFlare graphQL API to Prometheus.
CloudFlare graphQL API updates data every minute. To keep the system compliant with Prometheus logic, the exporter will aggregate data in the time window from four minutes back to three minutes back.
Run the app:
export TOKEN="<cloudflare_token>"
export ZONETAG="<cloudflare_zone_tag>"
export SUBSYSTEM="<my_org>"
make run
Build the app:
make build
./bin/cloudflare_exporter
There are two log levels, DEBUG
and INFO
. The DEBUG
log level is the default.
Set ENV
variable to prod
to run with INFO
log level.
The SUBSYSTEM
environment variable will be used as metrics subsystem. The variable can be used to differentiate metric names for different CloudFlare domain zones.
The default value is gather_town
.
Default metric names:
name |
---|
cloudflare_gather_town_browser_map_page_views_count |
cloudflare_gather_town_country_map_bytes_sum |
cloudflare_gather_town_country_map_requests_count |
cloudflare_gather_town_country_map_threats_count |
cloudflare_gather_town_response_bytes_count |
cloudflare_gather_town_response_status_count |
cloudflare_gather_town_visits_count |
For detailed explanation look at the metric description in the source code, Grafana or Prometheus.
- Add metrics from CloudFlare browser insights
See Licence