Conversation
`withSentry`, Durable Objects, Workflows and `WorkerEntrypoint` install the AsyncLocalStorage async context strategy. When an OpenTelemetry strategy already uses the same storage, replacing it while a request runs makes the OpenTelemetry context manager read a Sentry scope store as a context, and every later request fails with `context.getValue is not a function`. The AsyncLocalStorage strategy is now only installed when no OpenTelemetry strategy is installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
This branch has not been deployed
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.
withSentry, Durable Objects, Workflows andWorkerEntrypointinstall the AsyncLocalStorage async context strategy. When an OpenTelemetry strategy is already installed, the new strategy reuses itsAsyncLocalStoragebut stores Sentry scopes in it. The OpenTelemetry context manager then reads a scope store as a context, and every later request fails withcontext.getValue is not a function(#24603). They now keep an installed OpenTelemetry strategy.This is needed for
@sentry/nextjs/cloudflare, which installs the OpenTelemetry strategy before it callswithSentry, and for apps whoseregister()runs before the Worker entry. The check useswithActiveSpan, which only the OpenTelemetry strategy has, so no new marker is needed. The Pages plugin is unchanged.🤖 Generated with Claude Code