You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node-opentelemetry: app spans aren't recorded when the app uses OpenTelemetry JS 3 (@opentelemetry/api 1.10) #326
With @hyperdx/node-opentelemetry 0.11.0 in an app on OpenTelemetry JS 3 (@opentelemetry/api 1.10), spans the app creates through the API are not recording after init(), so they are never exported. The same code on API 1.9.1 records.
@hyperdx/node-opentelemetry lists @opentelemetry/api ^1.9.1 as a dependency, and its OTel SDK 2.x packages (sdk-node 0.218, core 2.x) need an API below 1.10, so npm nests 1.9.1 for it. init() registers the tracer provider through that copy. The app's 1.10 copy treats a global registered by an older minor as incompatible and returns a no-op tracer.
Node 25.6.1, npm 11.
Possible fixes
Move the Node SDK to OpenTelemetry JS 3 (sdk-node 0.301, @opentelemetry/sdk-trace in place of sdk-trace-base), which shares the app's API 1.10.
Or, until then, cap the supported API in the docs and warn at init() when a second API copy is detected, so the data loss isn't silent.
I'm happy to open a PR for whichever direction you prefer.
Activity