fix(opentelemetry): wrap sdk-trace TracerProvider for sdk-node 0.220+#9255
Conversation
@opentelemetry/sdk-node 0.220.0 builds its provider from @opentelemetry/sdk-trace's TracerProvider instead of sdk-trace-node's NodeTracerProvider, so the existing hook no longer intercepts it and DD_TRACE_OTEL_ENABLED spans are silently dropped. Hook the new export too.
Overall package sizeSelf size: 6.65 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 437.94 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: cf78a9a | Docs | Datadog PR Page | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9255 +/- ##
==========================================
- Coverage 96.54% 96.54% -0.01%
==========================================
Files 915 915
Lines 121018 121034 +16
Branches 20693 20817 +124
==========================================
+ Hits 116837 116851 +14
- Misses 4181 4183 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-07-08 10:24:42 Comparing candidate commit cf78a9a in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2312 metrics, 46 unstable metrics.
|
The hook-registration tests re-encoded the source: stubbed datadog-shimmer, pinned the addHook file/version literals, and counted the calls, so a refactor that merged the two hooks or renamed a hooked path broke them without any behavior change. Run the real shimmer over the captured transforms and assert each SDK provider export becomes the dd-trace TracerProvider instead. Coupling stays on the OTel packages' public export names, not our internal wiring.
…#9255) @opentelemetry/sdk-node 0.220.0 builds its provider from @opentelemetry/sdk-trace's TracerProvider instead of sdk-trace-node's NodeTracerProvider, so the existing hook no longer intercepts it and DD_TRACE_OTEL_ENABLED spans are silently dropped. Hook the new export too.
…#9255) @opentelemetry/sdk-node 0.220.0 builds its provider from @opentelemetry/sdk-trace's TracerProvider instead of sdk-trace-node's NodeTracerProvider, so the existing hook no longer intercepts it and DD_TRACE_OTEL_ENABLED spans are silently dropped. Hook the new export too.
Summary
@opentelemetry/sdk-node0.220.0 builds its provider from@opentelemetry/sdk-trace'sTracerProviderinstead ofsdk-trace-node'sNodeTracerProvider. The existing hook only wrapsNodeTracerProvider, so underDD_TRACE_OTEL_ENABLEDthe OTel-bridged spans stop reaching the tracer on 0.220+. This wraps thesdk-traceTracerProviderexport too, keeping the older hook for pre-0.220 and directNodeTracerProviderusers.Surfaced by the version bump in #9247, whose integration jobs fail on
should auto-instrument @opentelemetry/sdk-nodewith a fake-agent timeout (theotel-subspan never arrives).Why
master pins
@opentelemetry/sdk-nodeat 0.219.0 in the test-versions folder, so this PR's own integration CI still installs 0.219 and won't exercise the new path. Verified locally against 0.220.0: the existing integration test times out without this change and passes with it. #9247 becomes the end-to-end guard once it rebases on top.