Skip to content

fix(cloudflare): Instrument namespaces returned by jurisdiction() - #24450

Merged
JPeer264 merged 1 commit into
getsentry:developfrom
msnelling:fix/cloudflare-do-namespace-jurisdiction
Sep 17, 2026
Merged

JPeer264 merged 1 commit into
getsentry:developfrom
msnelling:fix/cloudflare-do-namespace-jurisdiction

Conversation

@msnelling

Copy link
Copy Markdown
Contributor

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

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • 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).

`jurisdiction()` returned the raw binding, so stubs from a
jurisdiction-restricted namespace got no fetch span and never propagated
RPC trace context. It now returns a namespace instrumented the same way
as its parent.

Fixes getsentry#24442

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@msnelling
msnelling requested a review from a team as a code owner September 16, 2026 17:46
@msnelling
msnelling requested review from isaacs and mydea and removed request for a team September 16, 2026 17:46
@JPeer264
JPeer264 requested review from JPeer264 and removed request for isaacs and mydea September 17, 2026 06:55

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing. Thanks a lot for adding it.

This has unit coverage only: local workerd throws "Jurisdiction restrictions are not implemented in workerd", so an integration suite can't exercise it.

This is ok, we'll add some deployed worker tests soon and I'll add this case then there too (#24280)

@JPeer264
JPeer264 merged commit 471157a into getsentry:develop Sep 17, 2026
84 checks passed
msonnb pushed a commit that referenced this pull request Sep 17, 2026
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #24450

Co-authored-by: JPeer264 <10677263+JPeer264@users.noreply.github.com>
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.

@sentry/cloudflare: stubs from namespace.jurisdiction() bypass Durable Object instrumentation

2 participants