Uh oh!
There was an error while loading. Please reload this page.
feat(opentelemetry): Add tracingChannel utility for context propagation - #20358
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Pull request overview
Adds a Node.js-only tracingChannel() utility to @sentry/opentelemetry to enable OpenTelemetry context propagation for node:diagnostics_channel tracing channels, with accompanying packaging and tests.
Changes:
- Added
src/tracingChannel.tsimplementingtracingChannel()with ALS-backed context propagation viabindStore. - Added a new
./tracingChannelpackage subpath export and Rollup entrypoint to build it separately from the main bundle. - Added Vitest coverage validating active-span behavior, nesting/parenting, and context non-leakage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
packages/opentelemetry/src/tracingChannel.ts | Implements the tracingChannel() wrapper and context binding logic. |
packages/opentelemetry/test/tracingChannel.test.ts | Adds unit tests for span activation, parent/child relationships, and context isolation. |
packages/opentelemetry/rollup.npm.config.mjs | Builds tracingChannel.ts as a separate entrypoint to keep Node-only deps out of the main bundle. |
packages/opentelemetry/package.json | Exposes ./tracingChannel subpath with ESM/CJS + types outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…context propagation Vendors and adapts the `otel-tracing-channel` package into `@sentry/opentelemetry`, providing a drop-in wrapper around Node.js `TracingChannel` that automatically binds OTel context propagation via `bindStore`. Uses our public `getAsyncLocalStorageLookup()` API to access the ALS instead of relying on OTel private internals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…a framework held together by ductape
f3b037f to
1b87a8fCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Implements HTTP server instrumentation for both `h3` and `srvx` by listening to their tracing channel events. - `h3` TC PR: h3js/h3#1251 - `srvx` TC PR: h3js/srvx#141Closes#18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5973ab5. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Implements HTTP server instrumentation for both `h3` and `srvx` by listening to their tracing channel events. - `h3` TC PR: h3js/h3#1251 - `srvx` TC PR: h3js/srvx#141Closes#18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements HTTP server instrumentation for both `h3` and `srvx` by listening to their tracing channel events. - `h3` TC PR: h3js/h3#1251 - `srvx` TC PR: h3js/srvx#141Closes#18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds automatic sourcemap handling to the Nitro SDK, using `@sentry/bundler-plugin-core` for builder-agnostic post-build upload. Nitro uses rollup or rolldown, so it made sense to make it as agnostic as possible. Closes#17992 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 - #19304 👈 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements HTTP server instrumentation for both `h3` and `srvx` by listening to their tracing channel events. - `h3` TC PR: h3js/h3#1251 - `srvx` TC PR: h3js/srvx#141Closes#18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds automatic sourcemap handling to the Nitro SDK, using `@sentry/bundler-plugin-core` for builder-agnostic post-build upload. Nitro uses rollup or rolldown, so it made sense to make it as agnostic as possible. Closes#17992 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 - #19304 👈 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements HTTP server instrumentation for both `h3` and `srvx` by listening to their tracing channel events. - `h3` TC PR: h3js/h3#1251 - `srvx` TC PR: h3js/srvx#141Closes#18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds automatic sourcemap handling to the Nitro SDK, using `@sentry/bundler-plugin-core` for builder-agnostic post-build upload. Nitro uses rollup or rolldown, so it made sense to make it as agnostic as possible. Closes#17992 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 - #19304 👈 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This PR just isolates the mundane changes needed for a new SDK to keep the next stacked PRs clean, it adds the Nitro SDK to the monorepo. This PR is a base of a stack, the stacked PRs will be merged into it. I thought this will be easier to review. --- **This PR is part of a stack:** - #20358 - #19224 👈 - #19225 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

otel-tracing-channelinto@sentry/opentelemetrytracingChannel()wrapper around Node.jsTracingChannelthat automatically binds OTel context propagation viabindStoregetAsyncLocalStorageLookup()API to access the ALS instead of relying on OTel private_asyncLocalStorageinternalssubscribe/unsubscribeaccept partial subscriber objects so callers only provide handlers they needThe util is exposed in a subpath export because nextjs does not externalize
node:diagnostic_channelsand will crash.