Problem
With channel-based (orchestrion diagnostics-channel) instrumentation now the default (#22345 / #22345), the default Express, Koa, and Hapi integrations no longer monkey-patch the app object via OpenTelemetry/shimmer. They subscribe to diagnostics channels instead.
However, setupExpressErrorHandler, setupKoaErrorHandler, and setupHapiErrorHandler still call ensureIsWrapped(app.use, '<framework>'), and ensureIsWrapped (packages/node/src/utils/ensureIsWrapped.ts) only detects OTel-style wrapping:
isWrapped(maybeWrappedFunction) || typeof getOriginalFunction(...) === 'function'
Under channel-based instrumentation the app object is not wrapped, so for a correctly-instrumented app this check is false and the SDK:
- logs a misleading
"[Sentry] <framework> is not instrumented..." console warning, and
- sets a
missing_instrumentation context on the global scope.
Spans are still recorded correctly (E2E is green) — this is cosmetic/misleading, not a functional break. disableInstrumentationWarnings: true silences it as a workaround.
Fix direction
Teach ensureIsWrapped to recognize channel-based instrumentation (e.g. detect that channel injection/subscribers are active for the framework), or skip the OTel-wrapping check when the integration is running in channel mode, so the warning and missing_instrumentation context only fire when instrumentation is genuinely absent.
Affected
packages/node/src/utils/ensureIsWrapped.ts
setupExpressErrorHandler / setupKoaErrorHandler / setupHapiErrorHandler call sites (Express: packages/node/src/integrations/tracing/express.ts)
Found by Cursor Bugbot on PR #22501 (Low severity).
Problem
With channel-based (orchestrion diagnostics-channel) instrumentation now the default (#22345 / #22345), the default Express, Koa, and Hapi integrations no longer monkey-patch the app object via OpenTelemetry/shimmer. They subscribe to diagnostics channels instead.
However,
setupExpressErrorHandler,setupKoaErrorHandler, andsetupHapiErrorHandlerstill callensureIsWrapped(app.use, '<framework>'), andensureIsWrapped(packages/node/src/utils/ensureIsWrapped.ts) only detects OTel-style wrapping:Under channel-based instrumentation the app object is not wrapped, so for a correctly-instrumented app this check is false and the SDK:
"[Sentry] <framework> is not instrumented..."console warning, andmissing_instrumentationcontext on the global scope.Spans are still recorded correctly (E2E is green) — this is cosmetic/misleading, not a functional break.
disableInstrumentationWarnings: truesilences it as a workaround.Fix direction
Teach
ensureIsWrappedto recognize channel-based instrumentation (e.g. detect that channel injection/subscribers are active for the framework), or skip the OTel-wrapping check when the integration is running in channel mode, so the warning andmissing_instrumentationcontext only fire when instrumentation is genuinely absent.Affected
packages/node/src/utils/ensureIsWrapped.tssetupExpressErrorHandler/setupKoaErrorHandler/setupHapiErrorHandlercall sites (Express: packages/node/src/integrations/tracing/express.ts)Found by Cursor Bugbot on PR #22501 (Low severity).