diff --git a/packages/opentelemetry/src/tracingChannel.ts b/packages/opentelemetry/src/tracingChannel.ts index 5548201c5f4c..88d0d384c58f 100644 --- a/packages/opentelemetry/src/tracingChannel.ts +++ b/packages/opentelemetry/src/tracingChannel.ts @@ -5,7 +5,7 @@ * using Node.js diagnostic_channel's `bindStore` mechanism. */ import type { TracingChannel, TracingChannelSubscribers } from 'node:diagnostics_channel'; -import { tracingChannel as nativeTracingChannel } from 'node:diagnostics_channel'; +import * as diagnosticsChannel from 'node:diagnostics_channel'; import type { Span } from '@opentelemetry/api'; import { context, trace } from '@opentelemetry/api'; import { logger } from '@sentry/core'; @@ -53,9 +53,10 @@ export function tracingChannel( channelNameOrInstance: string, transformStart: OtelTracingChannelTransform, ): OtelTracingChannel> { - const channel = nativeTracingChannel, TracingChannelContextWithSpan>( - channelNameOrInstance, - ) as unknown as OtelTracingChannel>; + const channel = diagnosticsChannel.tracingChannel< + TracingChannelContextWithSpan, + TracingChannelContextWithSpan + >(channelNameOrInstance) as unknown as OtelTracingChannel>; let lookup: AsyncLocalStorageLookup | undefined; try {