ref(cloudflare)!: Use shared SentryTracerProvider for OpenTelemetry interop - #23300
Draft
JPeer264 wants to merge 3 commits into
Draft
ref(cloudflare)!: Use shared SentryTracerProvider for OpenTelemetry interop#23300JPeer264 wants to merge 3 commits into
SentryTracerProvider for OpenTelemetry interop#23300JPeer264 wants to merge 3 commits into
Conversation
… interop Replaces the bespoke Cloudflare tracer with `SentryTracerProvider` from `@sentry/opentelemetry`, and covers `enableOpenTelemetrySetup` end to end in workerd with two integration suites. The enabled suite documents that `startActiveSpan` detaches into a root transaction of its own rather than nesting under the request span: it always resolves an explicit context, and Cloudflare installs no OTel context manager, so `context.active()` never carries the request span. `startSpan` passes no context and does nest, so both paths are asserted to pin the difference. The two workers are kept identical apart from the option itself, so the disabled suite also proves the wider OTel surface stays inert when the provider is off. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JPeer264
requested review from
andreiborza,
isaacs,
mydea and
s1gr1d
and removed request for
a team,
isaacs and
mydea
August 11, 2026 14:34
Contributor
size-limit report 📦
|
JPeer264
marked this pull request as draft
August 12, 2026 08:09
JPeer264
force-pushed
the
jp/cloudflare-tracerprovider
branch
2 times, most recently
from
August 12, 2026 08:46
28f82ba to
2f6a005
Compare
… OpenTelemetry interop
JPeer264
force-pushed
the
jp/cloudflare-tracerprovider
branch
from
August 12, 2026 08:47
2f6a005 to
03da001
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This uses now the
SentryTracerProviderand removes the previous kinda mocked provider. I added two integration tests that check if OTel traces are picked up by our provider—just to tripple check if the machinery is implemented correctly.I made it breaking since the
sentry.cloudflare_tracerattribute is being removed now (I added this as a fixup in the migration guide)Also for Hydrogen aka the
/requestentrypoint, we no longer support theenableOpenTelemetrySetupoption, as this would requirenode:async_hooks, which isn't available in Hydrogen. In case this would be needed in the future we can enable this and readd the previous OTel Tracer Provider. But for now it is better to keep it simple.Clanker machinery comment:
Replaces the bespoke Cloudflare tracer with
SentryTracerProviderfrom@sentry/opentelemetry, and coversenableOpenTelemetrySetupend to end in workerd with two integration suites.The enabled suite documents that
startActiveSpandetaches into a root transaction of its own rather than nesting under the request span: it always resolves an explicit context, and Cloudflare installs no OTel context manager, socontext.active()never carries the request span.startSpanpasses no context and does nest, so both paths are asserted to pin the difference.The two workers are kept identical apart from the option itself, so the disabled suite also proves the wider OTel surface stays inert when the provider is off.