Cloudflare Workers Integration

Axiom's Cloudflare Workers integration provides granular detail about the traffic coming in from your monitored sites. This includes edge requests, static resources, client auth, response duration, and status. Axiom gives you an all-at-once view of key Cloudflare worker's metrics and logs, out of the box, with our Dynamic Cloudflare workers dashboard.

The data obtained with the Axiom dashboard gives you better insights into the state of your Cloudflare workers so you can easily monitor bad requests, popular URLs, cumulative execution time, successful requests, and more. The integration is part of Axiom's unified logging and observability platform, so you can easily track Cloudflare Workers edge requests alongside a comprehensive view of other resources in your Cloudflare worker environments.

What is Cloudflare Workers

Cloudflare Workers is a serverless computing platform developed by Cloudflare. The Workers platform allows developers to deploy and run JavaScript code directly at the network edge in more than 200 data centers worldwide. This serverless architecture enables high performance, low latency, and efficient scaling for web applications and APIs.

Sending Cloudflare Worker logs to Axiom

The Axiom Cloudflare worker repository plugin is available on GitHub.

  1. Copy the contents of src/worker.js into a new worker on Cloudflare.

  2. Update the authentication variables to corresponding dataset and token:

const axiomDataset = "my-dataset" // Your Axiom dataset
const axiomToken = "xapt-xxx" // Your Axiom API token
  • The dataset is where your Cloudflare worker logs will be stored. Create a dataset from the settings page in the Axiom UI.

Add new layer

  • The Axiom token will be your API token with ingest and query permissions.

Add new layer

  1. Add triggers for the worker, e.g., a route trigger:
  • Navigate to the worker and click on the Triggers tab.

Cloudflare worker

  • Scroll down to Routes and click Add Route.

Cloudflare scroll down

  • Enter a route, e.g., *.example.com, choose the related zone, then click Save.

Cloudflare routes

View Cloudflare Workers Logs

When requests are made to the routes you set up, the worker will be triggered, and you will see the logs delivered to your Axiom dataset.

Cloudflare datasets

Was this page helpful?