Skip to content

Cloudflare worker to send metric upon pages to InfluxDB

License

Notifications You must be signed in to change notification settings

pyropy/cf-metrics

 
 

Repository files navigation

Cloudflare metrics worker

Send your page views from Cloudflare worker to InfluxDB.

Dashboard views

Requirements

  1. Your site need to be setup behind Cloudflare CDN.
  2. You need to setup InfluxDB with external access (make sure you have set authentication)
    1. Make sure InfluxDB is hosted under supported port for Workers. Best option is 80 or 443.

How to use

  1. Install wrangler package
npm i @cloudflare/wrangler -g
  1. Copy example files
cp .env.example .env
cp wrangler.toml.example wrangler.toml
  1. Deploy your worker to a site with wrangler
wrangler publish --env production
  1. (Optional) If you're using Grafana with InfluxDB, then you can import example Dashboard from first screen.

About

Cloudflare worker to send metric upon pages to InfluxDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%