Couldflare worker used to proxy requests to your application and send metrics to InfluxDB.
- Install dependencies
npm install
- Copy example files
cp .dev.vars.example .dev.vars
cp wrangler.toml.example wrangler.toml
-
Edit secrets inside
.dev.varsand environment variables insidewrangler.tomlfiles -
Run your worker
npm run dev
In order to deploy your worker via Github Actions, you need to have a Cloudflare API token and running instance of InfluxDB.
Add generated API token to Github secrets as CLOUDFLARE_API_TOKEN and authentication token under INFLUX_TOKEN.
Other required environment variables include the following:
INFLUX_URL- InfluxDB URLINFLUX_DATABASE- InfluxDB database (bucket) nameINFLUX_METRIC_NAME- InfluxDB metric name
After setting up secrets, you can push your code to Github and worker will be deployed to production environment automatically.