Skip to content

fix(node): Register diagnostics-channel injection in NodeClient con… - #24293

Merged
timfish merged 2 commits into
developfrom
timfish/fix/hook-registration
Sep 10, 2026
Merged

fix(node): Register diagnostics-channel injection in NodeClient con…#24293
timfish merged 2 commits into
developfrom
timfish/fix/hook-registration

Conversation

@timfish

@timfish timfish commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Move registerDiagnosticsChannelInjection() from the Node SDK's init() into the NodeClient constructor, so the injection hooks install for every client, not only the one built by init(). Downstream SDKs that construct a client without going through init() now get channel injection set up for them.

The call keeps its existing guards (the __SENTRY_CHANNEL_INJECTION__ build flag and enableRuntimeChannelInjection: false), read from the constructor's options. Registration is idempotent, so construction on any path stays safe. This follows the same constructor-anchoring pattern already used for _INTERNAL_setDeferSegmentSpanCapture and registerPrepareSpanScope.

@timfish
timfish requested a review from a team as a code owner September 10, 2026 11:22
@timfish
timfish requested review from logaretm and stephanie-anderson and removed request for a team September 10, 2026 11:22
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.92 kB - -
@sentry/browser - with treeshaking flags 27.21 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.11 kB - -
@sentry/browser (incl. Tracing) 50.28 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.29 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.27 kB - -
@sentry/browser (incl. Tracing, Replay) 89.77 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 78.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.47 kB - -
@sentry/browser (incl. Feedback) 46.41 kB - -
@sentry/browser (incl. sendFeedback) 33.97 kB - -
@sentry/browser (incl. FeedbackAsync) 39.08 kB - -
@sentry/browser (incl. Metrics) 29.93 kB - -
@sentry/browser (incl. Logs) 30.2 kB - -
@sentry/browser (incl. Metrics & Logs) 30.87 kB - -
@sentry/react 30.67 kB - -
@sentry/react (incl. Tracing) 52.6 kB - -
@sentry/vue 36.16 kB - -
@sentry/vue (incl. Tracing) 52.53 kB - -
@sentry/svelte 28.93 kB - -
CDN Bundle 30.66 kB - -
CDN Bundle (incl. Tracing) 50.78 kB - -
CDN Bundle (incl. Logs, Metrics) 32.93 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 52.74 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.62 kB - -
CDN Bundle (incl. Tracing, Replay) 88.33 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.37 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.38 kB - -
CDN Bundle - uncompressed 90.73 kB - -
CDN Bundle (incl. Tracing) - uncompressed 151.69 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.31 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 157.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.72 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 284.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 290.9 kB - -
@sentry/nextjs (client) 54.92 kB - -
@sentry/sveltekit (client) 50.7 kB - -
@sentry/core/server 37.08 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 128.59 kB +0.16% +198 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.82 kB - -
@sentry/node - without tracing 89.55 kB +0.63% +554 B 🔺
@sentry/node - without channel injection 107.53 kB +0.03% +23 B 🔺
@sentry/aws-serverless 97.77 kB +0.41% +392 B 🔺
@sentry/cloudflare (withSentry) - minified 203.01 kB - -
@sentry/cloudflare (withSentry) 505.44 kB - -

View base workflow run

@timfish

timfish commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Not sure I believe the size limit report 🤔

@timfish
timfish requested review from JPeer264 and removed request for stephanie-anderson September 10, 2026 11:39
@timfish

timfish commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Blocked on #24303

@timfish
timfish enabled auto-merge (squash) September 10, 2026 14:32
@timfish
timfish merged commit 9428d80 into develop Sep 10, 2026
215 of 216 checks passed
@timfish
timfish deleted the timfish/fix/hook-registration branch September 10, 2026 14:47
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.

2 participants