Skip to content

feat(server-utils): Rewrite @opentelemetry/instrumentation-generic-pool to orchestrion#22240

Merged
mydea merged 2 commits into
developfrom
francesconovy/js-2402-rewrite-opentelemetryinstrumentation-generic-pool-to
Jul 14, 2026
Merged

feat(server-utils): Rewrite @opentelemetry/instrumentation-generic-pool to orchestrion#22240
mydea merged 2 commits into
developfrom
francesconovy/js-2402-rewrite-opentelemetryinstrumentation-generic-pool-to

Conversation

@mydea

@mydea mydea commented Jul 14, 2026

Copy link
Copy Markdown
Member

Ports the generic-pool instrumentation from OTel's InstrumentationBase to an orchestrion diagnostics-channel listener.

  • Transform config (config/generic-pool.ts): injects the orchestrion:generic-pool:acquire channel into acquire for two shapes — v3+ class Pool { acquire(priority) } (promise, kind: 'Auto') and v2.4–v3 Pool.prototype.acquire = function acquire(callback, priority) (callback, kind: 'Callback'). Both publish to the same channel.

Version scope: v2.4+ and v3 are supported. v2.0–2.4 assigned an anonymous acquire per pool instance inside the Pool factory, which a static code transform has no named target to hook — the same boundary the original OTel instrumentation drew (it needed runtime factory-wrapping there). Under orchestrion those versions are not instrumented; the OTel integration still covers them when orchestrion is off.

So this only covers 2.4+ which seems acceptable, the vast majority of usage according to npm is 3+ anyhow.

Fixes #20751

🤖 Generated with Claude Code

…ool` to orchestrion

Ports the generic-pool instrumentation from `InstrumentationBase` to an
orchestrion diagnostics-channel listener. The transform injects the
`orchestrion:generic-pool:acquire` channel into `acquire` (v3's promise-based
class method and v2.4+'s callback-based prototype method), and
`genericPoolChannelIntegration` subscribes to it. Registered in
`channelIntegrations` so it 1:1 replaces the OTel `GenericPool` integration
when orchestrion is enabled.

Fixes #20751

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea requested review from a team as code owners July 14, 2026 08:24
@mydea
mydea requested review from JPeer264, andreiborza and isaacs and removed request for a team July 14, 2026 08:24
@linear-code

linear-code Bot commented Jul 14, 2026

Copy link
Copy Markdown

JS-2402

@mydea
mydea marked this pull request as draft July 14, 2026 08:25
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.65 kB - -
@sentry/browser - with treeshaking flags 26.1 kB - -
@sentry/browser (incl. Tracing) 46.42 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.21 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.2 kB - -
@sentry/browser (incl. Tracing, Replay) 85.67 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.31 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.38 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.04 kB - -
@sentry/browser (incl. Feedback) 44.83 kB - -
@sentry/browser (incl. sendFeedback) 32.45 kB - -
@sentry/browser (incl. FeedbackAsync) 37.58 kB - -
@sentry/browser (incl. Metrics) 28.74 kB - -
@sentry/browser (incl. Logs) 28.98 kB - -
@sentry/browser (incl. Metrics & Logs) 29.67 kB - -
@sentry/react 29.45 kB - -
@sentry/react (incl. Tracing) 48.68 kB - -
@sentry/vue 33.08 kB - -
@sentry/vue (incl. Tracing) 48.4 kB - -
@sentry/svelte 27.67 kB - -
CDN Bundle 30.05 kB - -
CDN Bundle (incl. Tracing) 48.41 kB - -
CDN Bundle (incl. Logs, Metrics) 31.64 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.71 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.87 kB - -
CDN Bundle (incl. Tracing, Replay) 85.9 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.97 kB - -
CDN Bundle - uncompressed 89.58 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.33 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.31 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.02 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.54 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.5 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.24 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.19 kB - -
@sentry/nextjs (client) 51.22 kB - -
@sentry/sveltekit (client) 46.86 kB - -
@sentry/core/server 78.47 kB - -
@sentry/core/browser 64.82 kB - -
@sentry/node-core 62.79 kB -0.01% -2 B 🔽
@sentry/node 125.2 kB - -
@sentry/node (incl. diagnostics channel injection) 139.87 kB +0.08% +108 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.96 kB - -
@sentry/node/light 50.8 kB - -
@sentry/node - without tracing 74.17 kB +0.01% +1 B 🔺
@sentry/aws-serverless 83.39 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 181.79 kB - -
@sentry/cloudflare (withSentry) 449.98 kB - -

View base workflow run

@JPeer264
JPeer264 removed their request for review July 14, 2026 09:32
@JPeer264

Copy link
Copy Markdown
Member

removed myself as reviewer as it is in draft, feel free to readd me once this is good to go

@mydea
mydea marked this pull request as ready for review July 14, 2026 09:33
@mydea
mydea merged commit dc87779 into develop Jul 14, 2026
428 of 430 checks passed
@mydea
mydea deleted the francesconovy/js-2402-rewrite-opentelemetryinstrumentation-generic-pool-to branch July 14, 2026 12:35
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.

Rewrite @opentelemetry/instrumentation-generic-pool to orchestrion

3 participants