@sentry/cloudflare: stubs from namespace.jurisdiction() bypass Durable Object instrumentation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- observability
Research direction
Start in packages/cloudflare/src/instrumentations/instrumentDurableObjectNamespace.ts, where the get trap currently special-cases get and getByName. Trace how other namespace functions are bound, then verify that jurisdiction() returns a recursively instrumented namespace with RPC trace propagation. Done means stubs obtained through a jurisdiction-restricted namespace produce the same fetch spans and sentry_rpc_meta behavior as direct namespace calls.
Written by the indexing model from the issue text.
Description
Environment
@sentry/cloudflare: 10.74.0 (also present ondevelopand11.0.0-beta.2)- Caller wrapped with
Sentry.withSentry(),enableRpcTracePropagation: true - Durable Object namespace restricted to a jurisdiction (
env.MY_DO.jurisdiction('eu'))
Description
instrumentDurableObjectNamespace wraps get and getByName so the returned stub gets fetch spans and
RPC trace propagation. Every other function on the namespace, including jurisdiction, goes through
value.bind(target), so a jurisdiction-restricted namespace is the raw binding. Stubs from it get
no fetch span and never append __sentry_rpc_meta__.
That applies to every Durable Object call from an app that uses data-location jurisdictions (for
example EU residency). The traces break at the Durable Object boundary. Combined with the receiver-side gap in #24443, the receiver
also loses all of its telemetry.
Reproduction
const ns = env.MY_DO.jurisdiction('eu');
const stub = ns.get(ns.idFromName('x'));
await stub.someRpcMethod('a'); // receiver sees no __sentry_rpc_meta__; no caller-side span
Compare with env.MY_DO.get(env.MY_DO.idFromName('x')), which does propagate.
Expected
jurisdiction() returns a namespace instrumented the same way, i.e.
instrumentDurableObjectNamespace(value.apply(target, args), propagateRpcTrace).
Code
packages/cloudflare/src/instrumentations/instrumentDurableObjectNamespace.ts: the get trap only
special-cases get/getByName.
- Dominant language
- TypeScript
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 576
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-javascript
-
Browser Bug Next.js Traces Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-javascript#24672 · 1 comment ·
-
Flaky Test React Router Framework Spans Tests
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-javascript#24348 · 1 comment ·
-
javascript
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-javascript#24200 · 2 comments ·
-
javascript Task
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
getsentry/sentry-javascript#24134 · 1 comment ·
-
Cloudflare Workers javascript Tests
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-javascript#24051 · 1 comment ·
All issues in getsentry/sentry-javascript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·