Skip to content

feat(node): Rewrite tedious instrumentation to orchestrion tracing channels - #22238

Merged
isaacs merged 1 commit into
developfrom
awad/js-2417-rewrite-opentelemetryinstrumentation-tedious-to-orchestrion
Jul 16, 2026
Merged

feat(node): Rewrite tedious instrumentation to orchestrion tracing channels#22238
isaacs merged 1 commit into
developfrom
awad/js-2417-rewrite-opentelemetryinstrumentation-tedious-to-orchestrion

Conversation

@logaretm

@logaretmlogaretm commented Jul 13, 2026

Copy link
Copy Markdown
Member

Migrates the tedious integration off the vendored InstrumentationBase onto a node:diagnostics_channel subscriber whose channels orchestrion injects into the library. The OTel path stays as the fallback when orchestrion isn't injected.

closes#20766

@linear-code

Copy link
Copy Markdown

JS-2417

@github-actions

github-actionsBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.67 kB--
@sentry/browser - with treeshaking flags26.12 kB--
@sentry/browser (incl. Tracing)46.44 kB--
@sentry/browser (incl. Tracing + Span Streaming)48.23 kB--
@sentry/browser (incl. Tracing, Profiling)51.23 kB--
@sentry/browser (incl. Tracing, Replay)85.69 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags75.33 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)90.41 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)103.07 kB--
@sentry/browser (incl. Feedback)44.85 kB--
@sentry/browser (incl. sendFeedback)32.47 kB--
@sentry/browser (incl. FeedbackAsync)37.6 kB--
@sentry/browser (incl. Metrics)28.77 kB--
@sentry/browser (incl. Logs)29 kB--
@sentry/browser (incl. Metrics & Logs)29.68 kB--
@sentry/react29.48 kB--
@sentry/react (incl. Tracing)48.7 kB--
@sentry/vue33.1 kB--
@sentry/vue (incl. Tracing)48.42 kB--
@sentry/svelte27.7 kB--
CDN Bundle30.07 kB--
CDN Bundle (incl. Tracing)48.43 kB--
CDN Bundle (incl. Logs, Metrics)31.65 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)49.73 kB--
CDN Bundle (incl. Replay, Logs, Metrics)70.89 kB--
CDN Bundle (incl. Tracing, Replay)85.93 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)87.23 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)91.72 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)92.98 kB--
CDN Bundle - uncompressed89.7 kB--
CDN Bundle (incl. Tracing) - uncompressed146.45 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed94.4 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed150.42 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed219.13 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed265.65 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed269.61 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed279.35 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed283.3 kB--
@sentry/nextjs (client)51.25 kB--
@sentry/sveltekit (client)46.88 kB--
@sentry/core/server78.54 kB--
@sentry/core/browser64.89 kB--
@sentry/node-core63.35 kB--
@sentry/node125.35 kB-0.01%-1 B 🔽
@sentry/node (incl. diagnostics channel injection)141.36 kB+0.56%+774 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)70.03 kB--
@sentry/node/light51.26 kB-0.01%-1 B 🔽
@sentry/node - without tracing74.64 kB-0.01%-1 B 🔽
@sentry/aws-serverless83.87 kB-0.01%-1 B 🔽
@sentry/cloudflare (withSentry) - minified181.91 kB--
@sentry/cloudflare (withSentry)450.25 kB--

View base workflow run

@logaretm
logaretmforce-pushed the awad/js-2417-rewrite-opentelemetryinstrumentation-tedious-to-orchestrion branch from f0842ac to 9a144ddCompareJuly 14, 2026 16:16
@logaretm
logaretm marked this pull request as ready for review July 14, 2026 17:32
@logaretm
logaretm requested review from a team as code ownersJuly 14, 2026 17:32
@logaretm
logaretm requested review from JPeer264, isaacs and mydea and removed request for a teamJuly 14, 2026 17:32

@cursorcursorBot 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 1 potential issue.

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 9a144dd. Configure here.

Comment threadpackages/server-utils/src/integrations/tracing-channel/tedious.ts Outdated
@logaretm
logaretmforce-pushed the awad/js-2417-rewrite-opentelemetryinstrumentation-tedious-to-orchestrion branch from 9a144dd to ca2f97cCompareJuly 14, 2026 18:09

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

Span attribs need an op. Other than that, this looks great.

…annels
Migrate the tedious integration off the vendored `InstrumentationBase` monkey-patch onto a `node:diagnostics_channel` subscriber whose channels are injected by the orchestrion code transform. The OTel path stays as the fallback when orchestrion isn't injected.
tedious is a default performance integration, so it uses the central `channelIntegrations` swap: `_init` filters the OTel `Tedious` integration out of the defaults by name and appends the channel one. No per-integration node code.
The subscriber wraps the six `Connection` request methods (one db span each) and `Connection.connect` (active-database bookkeeping). Each method returns synchronously while the request settles later via its callback/events, so the subscriber owns span-ending: it wraps `request.callback` and listens for the request `error` and connection `end` events, mirroring the vendored OTel instrumentation.
Fixes#20766
@logaretm
logaretmforce-pushed the awad/js-2417-rewrite-opentelemetryinstrumentation-tedious-to-orchestrion branch from ca2f97c to 5b723c2CompareJuly 15, 2026 22:43
@logaretm
logaretm requested a review from isaacsJuly 15, 2026 22:44
@isaacs
isaacs merged commit 27b350f into developJul 16, 2026
222 checks passed
@isaacs
isaacs deleted the awad/js-2417-rewrite-opentelemetryinstrumentation-tedious-to-orchestrion branch July 16, 2026 16:19
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.

Rewrite @opentelemetry/instrumentation-tedious to orchestrion

2 participants

@logaretm@isaacs