Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Wideplink/CF-Analytics-Exporter

Repository files navigation

CF Analytics Exporter

This project is to export analytics data from Cloudflare to Influxdb.

What is this?

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.

How to use

  1. Create a Cloudflare API Token. Follow this instruction.
    The token should have permissions below:

    • Account Analytics:Read
    • Account Settings:Read
    • Zone Analytics:Read
  2. Create a Influxdb database and token.

  3. Copy .env.example to .env and edit it.

  4. Run yarn install --immutable to install dependencies.

  5. Run yarn start to start the exporter.

Run as a service

You can run this exporter as a service.

  1. Copy cf-analytics-exporter.service to /etc/systemd/system/.
    • Make sure to check WorkingDirectory
  2. Run systemctl daemon-reload.
  3. Run systemctl enable cf-analytics-exporter --now.