This project is to export analytics data from Cloudflare to Influxdb.
Peridically, this exporter collects analytics data from GraphQL Analytics API and exports to Influxdb.
You can use dashboard in Influxdb or Grafana to visualize the data.
-
Create a Cloudflare API Token. Follow this instruction.
The token should have permissions below:- Account Analytics:Read
- Account Settings:Read
- Zone Analytics:Read
-
Create a Influxdb database and token.
-
Copy
.env.exampleto.envand edit it. -
Run
yarn install --immutableto install dependencies. -
Run
yarn startto start the exporter.
You can run this exporter as a service.
- Copy
cf-analytics-exporter.serviceto/etc/systemd/system/.- Make sure to check
WorkingDirectory
- Make sure to check
- Run
systemctl daemon-reload. - Run
systemctl enable cf-analytics-exporter --now.