Cloudflare Workers OpenTelemetry
Send logs and traces in 5 minutes
Export OpenTelemetry logs and traces from your Cloudflare Workers to Better Stack. Cloudflare's built-in Workers observability sends them for you, so no instrumentation code is required.
Create a source
Create an OpenTelemetry source and keep the tab open. You'll need its Ingesting host and Source token.
Add two Cloudflare destinations
In the Cloudflare dashboard, go to Workers & Pages → Observability → Telemetry and click Add destination once for traces and once for logs:
Enable observability in your Worker
Add the observability block to your wrangler.jsonc. The destinations names must match the destinations you just created:
Want to sample or keep a copy in Cloudflare?
head_sampling_rate: 1.0 exports every trace. Lower it to sample in production. persist: false sends data to Better Stack only. Set it to true to also keep logs and traces in Cloudflare.
Deploy your Worker
View your logs and traces
Open Better Stack → Live tail. Your first traces and logs arrive within a minute or two. Send requests to your Worker to see a span per request, each with its console.log lines linked to the trace.
Need help?
Please let us know at hello@betterstack.com.
We're happy to help! 🙏