Skip to content

feat(cloudflare): Add support for email, queue, and tail handler #16233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

Conversation

AbhiPrasad
Copy link
Member

Cloudflare workers have a variety of handlers you can define for different functionality: https://developers.cloudflare.com/workers/runtime-apis/handlers/

Right now our instrumentation wraps the fetch and scheduled handlers. This PR extends our instrumentation to also wrap the queue, email, and tail handler.

We only create spans for queue and email, but not for tail because its meant as a debugging/analytics endpoint. We can introduce spans in tail handler if there is demand in the future.

We need to add this wrapping, otherwise users cannot use the SDK in these handlers because of how the cloudflare isolation model works (fetch handler is completed isolated from email and queue handlers, so we need to wrap every handler individually).

@AbhiPrasad AbhiPrasad self-assigned this May 8, 2025
@AbhiPrasad AbhiPrasad merged commit f2afa29 into develop May 8, 2025
37 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-new-cloudflare-handlers branch May 8, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants