https://github.com/nftstorage/cloudflare-analytics-prometheus-exporter
***Notice: This repository is no longer maintained.***Cloudflare analytics prometheus exporter
https://github.com/nftstorage/cloudflare-analytics-prometheus-exporter
Last synced: 8 months ago
JSON representation
***Notice: This repository is no longer maintained.***Cloudflare analytics prometheus exporter
- Host: GitHub
- URL: https://github.com/nftstorage/cloudflare-analytics-prometheus-exporter
- Owner: nftstorage
- License: other
- Created: 2022-03-30T10:03:02.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-04T14:30:54.000Z (almost 4 years ago)
- Last Synced: 2025-05-31T04:34:47.350Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# cloudflare-analytics-prometheus-exporter
A tool to gather Cloudflare analytics from its GraphQL API and serve it in Prometheus format on `/metrics`.
## Usage
Drop a .env file in the project root and populate:
```sh
CF_API_TOKEN=
CF_AUTH_EMAIL=
CF_ZONE_ID=
PROM_NAMESPACE="nftlinkcf"
```
Replace the following values as specified:
* `CF_API_TOKEN` with a CF API Token with access for the Zone ID you want to export metrics from.
* `CF_AUTH_EMAIL` with a CF email account with access to the provided API Token.
* `CF_ZONE_ID` with the ID of the Cloudflare Zone you want to gather metrics.
Start the exporter:
```sh
npm start
```
Metrics for reports are available at `http://localhost:3000/metrics`
### Docker
There's a `Dockerfile` that runs the tool in docker.
```sh
docker build -t checkup .
docker run -d checkup
```