Conversation
…alls and instrument jurisdiction() Durable Object RPC methods only ran inside a Sentry client when the call carried trace metadata, so errors, logs and metrics from any other call were dropped. External calls without metadata now run capture-only, in a new trace. Calls the instance makes to its own methods stay unwrapped. `jurisdiction()` now returns an instrumented namespace, so its stubs propagate RPC trace context like those from `get()` and `getByName()`. Fixes getsentry#24442 Fixes getsentry#24443 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
msnelling
marked this pull request as ready for review
September 16, 2026 17:37
msnelling
requested review from
isaacs and
mydea
and removed request for
a team
September 16, 2026 17:37
This was referenced Sep 16, 2026
JPeer264
requested review from
JPeer264
and removed request for
isaacs and
mydea
September 17, 2026 06:55
JPeer264
pushed a commit
that referenced
this pull request
Sep 17, 2026
…4450) `instrumentDurableObjectNamespace` special-cases `get` and `getByName`, and binds every other function to the raw target. `jurisdiction()` therefore returned an uninstrumented namespace, so stubs from a jurisdiction-restricted namespace got no fetch span and never appended `__sentry_rpc_meta__`. Apps using data-location jurisdictions (for example EU residency) lost trace continuity at every Durable Object call. `jurisdiction()` now returns a namespace instrumented the same way as its parent, with the same `propagateRpcTrace` setting. This has unit coverage only: local workerd throws "Jurisdiction restrictions are not implemented in workerd", so an integration suite can't exercise it. Split out of #24447, which now covers #24443 only. Fixes #24442 - [x] If you've added code that should be tested, please add tests. - [x] Ensure your code lints and the test suite passes (`yarn lint`) & (`yarn test`). - [x] Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked. _Written with AI assistance (Claude Code)._ Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
also with RPC calls to check for potential regressions
JPeer264
approved these changes
Sep 17, 2026
JPeer264
left a comment
Member
There was a problem hiding this comment.
Thanks a lot for your contributions, I highly appreciate it. I added 2 more tests just to check for potential regressions - also to cover that in the future.
JPeer264
enabled auto-merge (squash)
September 17, 2026 12:59
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.
Durable Object RPC methods only got a Sentry client when the call carried
__sentry_rpc_meta__. Every other call ran with no client, so its errors, logs and metrics were dropped. That covers calls from uninstrumented workers, calls made outside the request's async context, and every call throughjurisdiction().jurisdiction()itself bypassedinstrumentDurableObjectNamespace, so its stubs never propagated a trace.External RPC calls without metadata now run capture-only (client, isolation scope and flush, but no span), which is what
instrumentWorkerEntrypointalready does.jurisdiction()now returns a namespace that is instrumented the same way as the parent.Some decisions worth calling out:
this.helper()call reaches the same wrapper as an external call. workerd dispatches an incoming RPC call outside any async context, so the wrapper treats a call made while an invocation is already in flight (isolation scope is not the default) as internal and runs the original method. Returning a proxy of the instance, asinstrumentWorkerEntrypointdoes, would bring back the private-field breakage from Cloudflare Agent RPC proxy breaks native private fields #23040. That's why the change only touches Durable Objects.startNewTracefor untraced calls, unlike WorkerEntrypoint. A Durable Object instance is long-lived and serves overlapping calls. Without a new trace, every untraced call inherits the propagation context of the default scope, so unrelated calls share one trace id. The overlapping-calls unit test fails without it.Fixes #24443
yarn lint) & (yarn test).Written with AI assistance (Claude Code).