fix(opentelemetry): wire span processors passed to the provider constructor#9285
Conversation
Overall package sizeSelf size: 6.71 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: 2a16095 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-10 17:38:15 Comparing candidate commit 2a16095 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2309 metrics, 49 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9285 +/- ##
========================================
Coverage 96.56% 96.57%
========================================
Files 918 918
Lines 121564 121582 +18
Branches 20883 21183 +300
========================================
+ Hits 117394 117412 +18
Misses 4170 4170 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:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f609f55283
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ructor @opentelemetry/sdk-node 0.220+ builds on @opentelemetry/sdk-trace 2.x, which dropped addSpanProcessor and hands span processors to the provider constructor instead. The dd-trace TracerProvider only consumed processors through addSpanProcessor, so a NodeSDK configured with a traceExporter or custom spanProcessors produced Datadog spans while the user's OTel processors never received onStart/onEnd. Consume config.spanProcessors through the same wiring, keeping the 1.x addSpanProcessor path for older SDKs that still call it.
@opentelemetry/sdk-node 0.49 and 0.50 pass configured processor instances to the provider constructor and addSpanProcessor, which otherwise invokes onStart and onEnd twice per span.
e24db82 to
2a16095
Compare
…ructor (#9285) @opentelemetry/sdk-node 0.220+ builds on @opentelemetry/sdk-trace 2.x, which dropped addSpanProcessor and hands span processors to the provider constructor instead. The dd-trace TracerProvider only consumed processors through addSpanProcessor, so a NodeSDK configured with a traceExporter or custom spanProcessors produced Datadog spans while the user's OTel processors never received onStart/onEnd. Consume config.spanProcessors through the same wiring, keeping the 1.x addSpanProcessor path for older SDKs that still call it.
…ructor (#9285) @opentelemetry/sdk-node 0.220+ builds on @opentelemetry/sdk-trace 2.x, which dropped addSpanProcessor and hands span processors to the provider constructor instead. The dd-trace TracerProvider only consumed processors through addSpanProcessor, so a NodeSDK configured with a traceExporter or custom spanProcessors produced Datadog spans while the user's OTel processors never received onStart/onEnd. Consume config.spanProcessors through the same wiring, keeping the 1.x addSpanProcessor path for older SDKs that still call it.
Summary
@opentelemetry/sdk-node0.220+ builds on@opentelemetry/sdk-trace2.x, which droppedaddSpanProcessorand hands span processors to the provider constructor instead. The dd-traceTracerProvideronly consumed processors throughaddSpanProcessor, so aNodeSDKconfigured with atraceExporteror customspanProcessorsproduced Datadog spans while the user's OTel processors never receivedonStart/onEnd. It now consumesconfig.spanProcessorsthrough the same wiring.Why
The hook targets
versions: ['*']for both@opentelemetry/sdk-trace-nodeand@opentelemetry/sdk-trace, so the replacement provider has to satisfy both configuration contracts at once: the 1.xaddSpanProcessorcall and the 2.x constructorspanProcessors. Routing the constructor wiring throughaddSpanProcessorkeeps the two paths from drifting apart.