Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Drive metrics from CloudFlare graphQL API to Prometheus

License

Notifications You must be signed in to change notification settings

gathertown/cloudflare_exporter

Repository files navigation

CloudFlare Exporter

Description

The project drives metrics from the CloudFlare graphQL API to Prometheus.

CloudFlare Data Extraction

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.

Develop

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.

Variables

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.

Metrics Exposed

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.

ROADMAP

License

See Licence

About

Drive metrics from CloudFlare graphQL API to Prometheus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published