Skip to content

axiomhq/axiom-cloudflare-workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axiom-cloudflare

Axiom.co banner  

Axiom unlocks observability at any scale.

  • Ingest with ease, store without limits: Axiom’s next-generation datastore enables ingesting petabytes of data with ultimate efficiency. Ship logs from Kubernetes, AWS, Azure, Google Cloud, DigitalOcean, Nomad, and others.
  • Query everything, all the time: Whether DevOps, SecOps, or EverythingOps, query all your data no matter its age. No provisioning, no moving data from cold/archive to “hot”, and no worrying about slow queries. All your data, all. the. time.
  • Powerful dashboards, for continuous observability: Build dashboards to collect related queries and present information that’s quick and easy to digest for you and your team. Dashboards can be kept private or shared with others, and are the perfect way to bring together data from different sources.

For more information, check out the official documentation and our community Discord.


This worker script can send logs from Cloudflare to Axiom.

Quickstart

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

Update the authentication variables to corresponding dataset and token:

const axiomDataset = "my-dataset" // Your Axiom dataset
const axiomToken = "xapt-xxx" // Your Axiom API token

Update the log filter variable to only send logs with status code above or equal (default to HTTP code 100):

const logsHttpMinStatusCode = 100 // Filter logs and send only logs with status code above or equal

Add triggers for the worker, e.g a route trigger:

  • Navigate to the worker and click on the Triggers tab.
  • Scroll down to Routes and click Add Route.
  • Enter a route, e.g *.example.com and choose the related zone, then click Save.

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