Skip to content

feat(cloudflare): Enable RPC trace propagation with enableRpcTracePropagation - #20345

Merged
JPeer264 merged 2 commits into
developfrom
jp/hide-rpc-behind-option
Apr 16, 2026
Merged

feat(cloudflare): Enable RPC trace propagation with enableRpcTracePropagation#20345
JPeer264 merged 2 commits into
developfrom
jp/hide-rpc-behind-option

Conversation

@JPeer264

@JPeer264JPeer264 commented Apr 16, 2026

Copy link
Copy Markdown
Member

follow up to #19991

It is better to release it first with an option to be enabled, that would then also be in line with #20343, otherwise .fetch() RPC calls would work without any option and the actual Cap'n'Proto RPC calls wouldn't work without. That would be an odd experience.

New option: enableRpcTracePropagation

instrumentPrototypeMethods has been deprecated in favor of enableRpcTracePropagation

Replaces the deprecated instrumentPrototypeMethods option with a clearer name that describes what it actually does. This option must be enabled on both the caller (Worker) and receiver (Durable Object) sides for trace propagation to work.

It is also worth to mention that the implementation of "instrumenting prototype methods" has changed to a Proxy.

// Worker sideexportdefaultSentry.withSentry((env)=>({dsn: env.SENTRY_DSN,enableRpcTracePropagation: true,}),handler,);// Durable Object sideexportconstMyDurableObject=Sentry.instrumentDurableObjectWithSentry((env)=>({dsn: env.SENTRY_DSN,enableRpcTracePropagation: true,}),MyDurableObjectBase,);

@JPeer264
JPeer264 requested review from Lms24 and s1gr1dApril 16, 2026 09:36
@JPeer264JPeer264 self-assigned this Apr 16, 2026
@JPeer264
JPeer264force-pushed the jp/hide-rpc-behind-option branch from 79e6052 to a11d4aeCompareApril 16, 2026 09:42
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser25.78 kB--
@sentry/browser - with treeshaking flags24.27 kB--
@sentry/browser (incl. Tracing)43.61 kB--
@sentry/browser (incl. Tracing + Span Streaming)45.32 kB--
@sentry/browser (incl. Tracing, Profiling)48.51 kB--
@sentry/browser (incl. Tracing, Replay)82.74 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags72.25 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)87.43 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)99.67 kB--
@sentry/browser (incl. Feedback)42.59 kB--
@sentry/browser (incl. sendFeedback)30.45 kB--
@sentry/browser (incl. FeedbackAsync)35.45 kB--
@sentry/browser (incl. Metrics)27.07 kB--
@sentry/browser (incl. Logs)27.2 kB--
@sentry/browser (incl. Metrics & Logs)27.89 kB--
@sentry/react27.53 kB--
@sentry/react (incl. Tracing)45.88 kB--
@sentry/vue30.61 kB--
@sentry/vue (incl. Tracing)45.45 kB--
@sentry/svelte25.8 kB--
CDN Bundle28.46 kB--
CDN Bundle (incl. Tracing)44.69 kB--
CDN Bundle (incl. Logs, Metrics)29.83 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)45.78 kB--
CDN Bundle (incl. Replay, Logs, Metrics)68.73 kB--
CDN Bundle (incl. Tracing, Replay)81.65 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)82.73 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)87.17 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)88.23 kB--
CDN Bundle - uncompressed83.12 kB--
CDN Bundle (incl. Tracing) - uncompressed133.64 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed87.27 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed137.05 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed210.63 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed250.87 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed254.27 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed263.78 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed267.17 kB--
@sentry/nextjs (client)48.42 kB--
@sentry/sveltekit (client)44.06 kB--
@sentry/node-core57.94 kB+0.02%+6 B 🔺
@sentry/node174.78 kB+0.01%+7 B 🔺
@sentry/node - without tracing97.89 kB+0.03%+21 B 🔺
@sentry/aws-serverless115.12 kB+0.01%+7 B 🔺

View base workflow run

@s1gr1ds1gr1d 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.

Looks good

@JPeer264
JPeer264 merged commit 5f72df5 into developApr 16, 2026
114 of 115 checks passed
@JPeer264
JPeer264 deleted the jp/hide-rpc-behind-option branch April 16, 2026 11:25
andreiborza pushed a commit that referenced this pull request Apr 20, 2026
…pagation (#20345)
follow up to #19991
It is better to release it first with an option to be enabled, that
would then also be in line with #20343, otherwise `.fetch()` RPC calls
would work without any option and the actual Cap'n'Proto RPC calls
wouldn't work without. That would be an odd experience.
### New option: `enableRpcTracePropagation`
> `instrumentPrototypeMethods` has been deprecated in favor of
`enableRpcTracePropagation`
Replaces the deprecated `instrumentPrototypeMethods` option with a
clearer name that describes what it actually does. This option must be
enabled on **both** the caller (Worker) and receiver (Durable Object)
sides for trace propagation to work.
It is also worth to mention that the implementation of "instrumenting
prototype methods" has changed to a Proxy.
```ts
// Worker side
export default Sentry.withSentry(
(env) => ({
dsn: env.SENTRY_DSN,
enableRpcTracePropagation: true,
}),
handler,
);
// Durable Object side
export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry(
(env) => ({
dsn: env.SENTRY_DSN,
enableRpcTracePropagation: true,
}),
MyDurableObjectBase,
);
```
Sign up for freeto 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.

3 participants

@JPeer264@Lms24@s1gr1d