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.example
to.env
and edit it. -
Run
yarn install --immutable
to install dependencies. -
Run
yarn start
to start the exporter.
You can run this exporter as a service.
- Copy
cf-analytics-exporter.service
to/etc/systemd/system/
.- Make sure to check
WorkingDirectory
- Make sure to check
- Run
systemctl daemon-reload
. - Run
systemctl enable cf-analytics-exporter --now
.