Skip to content

feat: Adopt bindTracingChannelToSpan across runtimes#21642

Open
logaretm wants to merge 2 commits into
awad/bind-tracing-channelfrom
awad/adopt-bind-tracing-channel
Open

feat: Adopt bindTracingChannelToSpan across runtimes#21642
logaretm wants to merge 2 commits into
awad/bind-tracing-channelfrom
awad/adopt-bind-tracing-channel

Conversation

@logaretm

@logaretm logaretm commented Jun 18, 2026

Copy link
Copy Markdown
Member

This PR adopts bindTracingChannelToSpan utility across our packages, and drops the tracingChannel helper we had.

The tracingChannel drop isn't a breaking change imo, its an internal export used by us exclusively.

@logaretm logaretm force-pushed the awad/bind-tracing-channel branch from 8c4ca47 to 61a560f Compare June 18, 2026 17:56
@logaretm logaretm force-pushed the awad/adopt-bind-tracing-channel branch from e189fda to 3f71785 Compare June 18, 2026 17:56
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.45 kB - -
@sentry/browser - with treeshaking flags 25.88 kB - -
@sentry/browser (incl. Tracing) 45.94 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.7 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.73 kB - -
@sentry/browser (incl. Tracing, Replay) 85.14 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.73 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.83 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.49 kB - -
@sentry/browser (incl. Feedback) 44.62 kB - -
@sentry/browser (incl. sendFeedback) 32.25 kB - -
@sentry/browser (incl. FeedbackAsync) 37.38 kB - -
@sentry/browser (incl. Metrics) 28.52 kB - -
@sentry/browser (incl. Logs) 28.76 kB - -
@sentry/browser (incl. Metrics & Logs) 29.45 kB - -
@sentry/react 29.25 kB - -
@sentry/react (incl. Tracing) 48.24 kB - -
@sentry/vue 32.61 kB - -
@sentry/vue (incl. Tracing) 47.8 kB - -
@sentry/svelte 27.48 kB - -
CDN Bundle 29.84 kB - -
CDN Bundle (incl. Tracing) 47.85 kB - -
CDN Bundle (incl. Logs, Metrics) 31.39 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.19 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.7 kB - -
CDN Bundle (incl. Tracing, Replay) 85.21 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.31 kB - -
CDN Bundle - uncompressed 88.8 kB - -
CDN Bundle (incl. Tracing) - uncompressed 144.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 93.5 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 148.81 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.33 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 263.7 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 267.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 277.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 281.35 kB - -
@sentry/nextjs (client) 50.63 kB - -
@sentry/sveltekit (client) 46.33 kB - -
@sentry/core/server 75.89 kB +0.06% +42 B 🔺
@sentry/core/browser 63.03 kB +0.03% +14 B 🔺
@sentry/node-core 61.7 kB +0.13% +76 B 🔺
@sentry/node 123.24 kB -0.54% -658 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.05 kB - -
@sentry/node/light 50.6 kB +0.11% +52 B 🔺
@sentry/node - without tracing 74.18 kB +0.08% +53 B 🔺
@sentry/aws-serverless 85.3 kB +0.08% +65 B 🔺
@sentry/cloudflare (withSentry) - minified 173.12 kB +0.14% +226 B 🔺
@sentry/cloudflare (withSentry) 432.9 kB +0.1% +427 B 🔺

View base workflow run

@logaretm logaretm force-pushed the awad/adopt-bind-tracing-channel branch 2 times, most recently from 8ec64f0 to 7a09a2e Compare June 19, 2026 01:18
expect.objectContaining({
handled: false,
type: 'auto.http.nitro.onTraceError',
type: 'auto.diagnostic_channels.bind_span',

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.

this is no good, this should be somewhat similar to what it was before 😬

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I can add an option for error mechanism to preserve this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in d452bdb

@logaretm logaretm marked this pull request as ready for review June 19, 2026 13:24
@logaretm logaretm requested review from a team as code owners June 19, 2026 13:24
@logaretm logaretm requested review from JPeer264, chargome, mydea and s1gr1d and removed request for a team June 19, 2026 13:24
@logaretm logaretm force-pushed the awad/bind-tracing-channel branch from 2fbdda3 to 3cb7959 Compare June 19, 2026 13:24
@logaretm logaretm force-pushed the awad/adopt-bind-tracing-channel branch from 7a09a2e to a11202f Compare June 19, 2026 13:31
Comment thread packages/nitro/src/runtime/hooks/captureTracingEvents.ts
@logaretm logaretm force-pushed the awad/bind-tracing-channel branch from 3cb7959 to e34e28a Compare June 19, 2026 13:57
@logaretm logaretm force-pushed the awad/adopt-bind-tracing-channel branch from d452bdb to 2d8060e Compare June 19, 2026 13:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2d8060e. Configure here.

Comment thread packages/nitro/src/runtime/hooks/captureTracingEvents.ts
Comment thread packages/nitro/src/runtime/hooks/captureTracingEvents.ts
Comment thread packages/nitro/src/runtime/hooks/captureStorageEvents.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2d8060e. Configure here.

Comment thread packages/nitro/src/runtime/hooks/captureStorageEvents.ts
Comment thread packages/nitro/src/runtime/hooks/captureTracingEvents.ts
@logaretm logaretm requested review from andreiborza and isaacs June 19, 2026 14:46
logaretm added 2 commits June 19, 2026 11:05
Migrate the Nitro HTTP/storage channels and the node/deno redis
diagnostics_channel subscribers off the `@sentry/opentelemetry`
`tracingChannel` helper onto `bindTracingChannelToSpan` from
`@sentry/server-utils`, using the `auto` lifecycle.

- Add `beforeSpanEnd(span, data)` to enrich the span on the canonical
  terminal event (sync `end` / async `asyncEnd`) right before it ends.
- Add `captureError` (default `true`) to gate exception capture; the span
  error status is always set. Redis opts out (`captureError: false`) since
  command failures are captured at the boundary that owns them.
- Unify the error mechanism to `auto.diagnostic_channels.bind_span`.
- Create channel spans with `startInactiveSpan`; the binding activates the
  span as the async context, so parenting is preserved.
- node and deno redis now pass the native `node:diagnostics_channel`
  `tracingChannel` directly; deno's bespoke factory is removed.

BREAKING: remove the `@sentry/opentelemetry/tracing-channel` subpath
export (shipped in 10.58.0); use `bindTracingChannelToSpan` instead.
@logaretm logaretm force-pushed the awad/adopt-bind-tracing-channel branch from 766b254 to 05cfa5b Compare June 19, 2026 15:07
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