feat(opentelemetry): Add tracingChannel utility for context propagation#20358
Merged
feat(opentelemetry): Add tracingChannel utility for context propagation#20358
Conversation
This was referenced Apr 16, 2026
Contributor
size-limit report 📦
|
Contributor
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.
…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
1b87a8f
Compare
timfish
approved these changes
Apr 16, 2026
s1gr1d
approved these changes
Apr 17, 2026
logaretm
added a commit
that referenced
this pull request
Apr 17, 2026
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#141 Closes #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.
logaretm
added a commit
that referenced
this pull request
Apr 17, 2026
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#141 Closes #18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
logaretm
added a commit
that referenced
this pull request
Apr 18, 2026
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#141 Closes #18123 --- **This PR is part of a stack:** - #20358 - #19224 - #19225 👈 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.