Skip to content

feat(server-utils): Migrate @opentelemetry/instrumentation-redis to orchestrion#21925

Draft
chargome wants to merge 10 commits into
developfrom
charlygomez/js-2416-rewrite-opentelemetryinstrumentation-redis-to-orchestrion
Draft

feat(server-utils): Migrate @opentelemetry/instrumentation-redis to orchestrion#21925
chargome wants to merge 10 commits into
developfrom
charlygomez/js-2416-rewrite-opentelemetryinstrumentation-redis-to-orchestrion

Conversation

@chargome

@chargome chargome commented Jul 2, 2026

Copy link
Copy Markdown
Member

closes #20765

chargome and others added 10 commits June 29, 2026 17:24
Resolve conflict in experimentalUseDiagnosticsChannelInjection.ts: keep develop's
derive-from-names for the 1:1 channel replacements (mysql, lru-memoizer) and add
ioredisChannelIntegration separately, kept out of replacedOtelIntegrationNames
since it only supersedes the ioredis sub-part of the composite OTel 'Redis'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rvives bundling

ioredis' connect() calls standard-as-callback's CJS default export; left
external it resolves to a non-function in the nitro/Rollup bundle. Inline it
alongside ioredis so the interop links consistently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Keep the OTel ioredis monkey-patch on Node without tracingChannel (<18.19)
  even when injection is opted in, since orchestrion can't run there — otherwise
  ioredis <5.11.0 would lose tracing entirely.
- Defer the orchestrion ioredis bindTracingChannelToSpan calls via
  waitForTracingChannelBinding, matching the native redis diagnostics-channel
  subscriber, so the async-context binding registered by initOpenTelemetry() is
  available before binding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nstrumentation

The orchestrion opt-in imports cacheResponseHook; importing it from redis/index
transitively pulled the vendored OTel IORedisInstrumentation/RedisInstrumentation
into the opt-in module graph. Move cacheResponseHook + _redisOptions into
redis/cache.ts (no OTel instrumentation imports) so apps using injection only for
mysql/lru-memoizer don't bundle the redis OTel instrumentation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
develop now runs all node-integration tests a second time with INJECT_ORCHESTRION
(#21911). Under orchestrion, ioredis <5.11 is instrumented by the diagnostics-channel
subscriber, so its span origin is 'auto.db.orchestrion.redis' instead of the OTel
monkey-patch's 'auto.db.otel.redis'. Branch the expected ioredis origin on
isOrchestrionEnabled(); node-redis (redis-4/redis-5) is not ported and keeps the OTel
origin. All other span attributes are identical.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

JS-2416

@chargome chargome self-assigned this Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.59 kB added added
@sentry/browser - with treeshaking flags 26.03 kB added added
@sentry/browser (incl. Tracing) 46.24 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.01 kB added added
@sentry/browser (incl. Tracing, Replay) 85.49 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.1 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.19 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 102.84 kB added added
@sentry/browser (incl. Feedback) 44.76 kB added added
@sentry/browser (incl. sendFeedback) 32.38 kB added added
@sentry/browser (incl. FeedbackAsync) 37.51 kB added added
@sentry/browser (incl. Metrics) 28.67 kB added added
@sentry/browser (incl. Logs) 28.91 kB added added
@sentry/browser (incl. Metrics & Logs) 29.59 kB added added
@sentry/react 29.38 kB added added
@sentry/react (incl. Tracing) 48.51 kB added added
@sentry/vue 33.03 kB added added
@sentry/vue (incl. Tracing) 48.11 kB added added
@sentry/svelte 27.61 kB added added
CDN Bundle 30 kB added added
CDN Bundle (incl. Tracing) 48.22 kB added added
CDN Bundle (incl. Logs, Metrics) 31.57 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.53 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 70.77 kB added added
CDN Bundle (incl. Tracing, Replay) 85.68 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.97 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.5 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.77 kB added added
CDN Bundle - uncompressed 89.35 kB added added
CDN Bundle (incl. Tracing) - uncompressed 145.92 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.89 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.59 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.93 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.89 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.63 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.58 kB added added
@sentry/nextjs (client) 50.95 kB added added
@sentry/sveltekit (client) 46.65 kB added added
@sentry/core/server 78.28 kB added added
@sentry/core/browser 64.62 kB added added
@sentry/node-core 63.18 kB added added
@sentry/node 122.81 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB added added
@sentry/node/light 50.7 kB added added
@sentry/node - without tracing 74.22 kB added added
@sentry/aws-serverless 85.01 kB added added
@sentry/cloudflare (withSentry) - minified 181.52 kB added added
@sentry/cloudflare (withSentry) 449.12 kB added added

Base automatically changed from cg/redisio-orchestrion to develop July 3, 2026 09:28
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.

1 participant