Skip to main content
Here’s a quick guide to setting up Subtrace in your Cloudflare Workers. First, add @subtrace/cloudflare to your Worker package.json:
Wrap your Worker’s fetch handler to use the Subtrace middleware:
src/index.js
Set a SUBTRACE_TOKEN environment variable in your Wrangler config file:
wrangler.jsonc
Deploy your Cloudflare Worker:
And that’s it, you can now see all inbound and outbound HTTP requests in your Cloudflare Worker via the Subtrace dashboard!