Skip to content

fix(opentelemetry): wire span processors passed to the provider constructor#9285

Merged
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-07-10-otel-tracerprovider-span-processors
Jul 14, 2026
Merged

fix(opentelemetry): wire span processors passed to the provider constructor#9285
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-07-10-otel-tracerprovider-span-processors

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

@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. It now consumes config.spanProcessors through the same wiring.

Why

The hook targets versions: ['*'] for both @opentelemetry/sdk-trace-node and @opentelemetry/sdk-trace, so the replacement provider has to satisfy both configuration contracts at once: the 1.x addSpanProcessor call and the 2.x constructor spanProcessors. Routing the constructor wiring through addSpanProcessor keeps the two paths from drifting apart.

@dd-octo-sts

dd-octo-sts Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.71 MB
Deduped: 7.37 MB
No deduping: 7.37 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

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 96.53% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2a16095 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 10, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-10 17:38:15

Comparing candidate commit 2a16095 in PR branch BridgeAR/2026-07-10-otel-tracerprovider-span-processors with baseline commit b968578 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2309 metrics, 49 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-211.932ms; +206.958ms] or [-7.910%; +7.724%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-236797.059µs; +236100.459µs] or [-9.302%; +9.275%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-161.844ms; +157.022ms] or [-5.231%; +5.075%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-186.538ms; +181.053ms] or [-6.430%; +6.241%]

scenario:appsec-control-20

  • unstable execution_time [-124.588ms; +130.545ms] or [-7.601%; +7.965%]

scenario:appsec-control-24

  • unstable execution_time [-113661.302µs; +113707.002µs] or [-9.162%; +9.165%]

scenario:appsec-control-26

  • unstable execution_time [-131.895ms; +125.531ms] or [-10.603%; +10.091%]

scenario:appsec-iast-with-vulnerability-iast-enabled-always-active-20

  • unstable cpu_usage_percentage [-5.523%; +5.418%]
  • unstable execution_time [-39.078ms; +43.469ms] or [-7.046%; +7.837%]

scenario:child_process-shell-string-24

  • unstable execution_time [-16178.276µs; +16706.483µs] or [-5.042%; +5.207%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-2381.032ms; +2204.174ms] or [-26.360%; +24.402%]
  • unstable execution_time [-2482.031ms; +2320.915ms] or [-25.463%; +23.810%]
  • unstable instructions [-20304.4M instructions; +19059.4M instructions] or [-27.363%; +25.685%]
  • unstable max_rss_usage [-10730.007KB; +9690.807KB] or [-6.739%; +6.086%]
  • unstable throughput [-644.368op/s; +681.298op/s] or [-18.867%; +19.949%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-4158.946ms; +2339.239ms] or [-38.056%; +21.405%]
  • unstable execution_time [-4250.202ms; +2372.430ms] or [-36.440%; +20.341%]
  • unstable instructions [-37.0G instructions; +20.6G instructions] or [-40.268%; +22.356%]
  • unstable max_rss_usage [-13.146MB; +7.193MB] or [-8.044%; +4.401%]
  • unstable throughput [-530.389op/s; +851.692op/s] or [-17.958%; +28.837%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1.730s; +4.191s] or [-19.129%; +46.334%]
  • unstable execution_time [-1.748s; +4.205s] or [-17.880%; +43.004%]
  • unstable instructions [-14.8G instructions; +35.7G instructions] or [-19.900%; +48.098%]
  • unstable max_rss_usage [-8.524MB; +18.070MB] or [-5.331%; +11.302%]
  • unstable throughput [-1112.730op/s; +436.661op/s] or [-32.551%; +12.774%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-1809.785ms; +611.735ms] or [-19.350%; +6.541%]
  • unstable execution_time [-1823.679ms; +614.840ms] or [-18.091%; +6.099%]
  • unstable instructions [-16.1G instructions; +5.5G instructions] or [-20.681%; +7.018%]
  • unstable throughput [-139.447op/s; +396.928op/s] or [-4.281%; +12.187%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-4.375s; +1.359s] or [-42.257%; +13.123%]
  • unstable execution_time [-4.395s; +1.358s] or [-39.678%; +12.262%]
  • unstable instructions [-37.5G instructions; +11.6G instructions] or [-43.927%; +13.544%]
  • unstable max_rss_usage [-18.871MB; +5.494MB] or [-11.387%; +3.315%]
  • unstable throughput [-354.372op/s; +1210.727op/s] or [-11.505%; +39.306%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-2079.346ms; +3389.875ms] or [-22.248%; +36.270%]
  • unstable execution_time [-2246.848ms; +3584.103ms] or [-22.284%; +35.547%]
  • unstable instructions [-18.1G instructions; +29.5G instructions] or [-23.215%; +37.913%]
  • unstable max_rss_usage [-7.061MB; +9.365MB] or [-4.423%; +5.866%]
  • unstable throughput [-760.928op/s; +474.970op/s] or [-23.299%; +14.543%]

scenario:dogstatsd-aggregated-26

  • unstable cpu_usage_percentage [-5.653%; +5.686%]
  • unstable execution_time [-77.908ms; +82.820ms] or [-7.580%; +8.058%]
  • unstable throughput [-880048.310op/s; +869016.446op/s] or [-5.943%; +5.868%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-188.221ms; +494.698ms] or [-4.068%; +10.692%]
  • unstable execution_time [-187.334ms; +495.233ms] or [-3.984%; +10.531%]
  • unstable throughput [-169857.353op/s; +66773.309op/s] or [-9.535%; +3.748%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-715.254ms; +695.344ms] or [-5.566%; +5.411%]
  • unstable execution_time [-722.042ms; +700.652ms] or [-5.498%; +5.335%]
  • unstable throughput [-3.219op/s; +3.327op/s] or [-5.253%; +5.429%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-3.130MB; +6.938MB] or [-3.951%; +8.760%]

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (b968578) to head (2a16095).

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            
Flag Coverage Δ
aiguard 53.55% <ø> (-0.05%) ⬇️
aiguard-integration 57.00% <ø> (ø)
apm-bucket-0 53.78% <ø> (-0.05%) ⬇️
apm-bucket-1 58.07% <ø> (-0.05%) ⬇️
apm-bucket-2 56.11% <ø> (-0.05%) ⬇️
apm-capabilities-tracing 60.32% <100.00%> (+<0.01%) ⬆️
apm-integrations-aerospike 52.93% <ø> (-0.05%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.05% <ø> (+0.01%) ⬆️
apm-integrations-couchbase 53.26% <ø> (-0.05%) ⬇️
apm-integrations-http 57.95% <ø> (-0.05%) ⬇️
apm-integrations-kafkajs 57.71% <ø> (-0.05%) ⬇️
apm-integrations-next 54.23% <ø> (-0.05%) ⬇️
apm-integrations-prisma 54.17% <51.28%> (-0.04%) ⬇️
apm-integrations-tedious 53.04% <ø> (-0.05%) ⬇️
appsec 68.95% <ø> (-0.04%) ⬇️
appsec-express_fastify_graphql 65.59% <ø> (-0.05%) ⬇️
appsec-integration 45.58% <ø> (ø)
appsec-kafka_ldapjs_lodash 59.09% <ø> (-0.04%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.24% <ø> (-0.04%) ⬇️
appsec-next 52.84% <ø> (-0.04%) ⬇️
appsec-node-serialize_passport_postgres 61.87% <ø> (-0.04%) ⬇️
appsec-sourcing_stripe_template 60.23% <ø> (-0.04%) ⬇️
debugger 65.71% <ø> (-0.02%) ⬇️
instrumentations-bucket-0 48.74% <ø> (-0.05%) ⬇️
instrumentations-bucket-1 54.95% <ø> (-0.05%) ⬇️
instrumentations-bucket-10 56.61% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 48.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 48.84% <ø> (-0.05%) ⬇️
instrumentations-bucket-13 48.67% <ø> (-0.05%) ⬇️
instrumentations-bucket-2 49.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-3 53.82% <ø> (-0.05%) ⬇️
instrumentations-bucket-4 49.15% <ø> (-0.05%) ⬇️
instrumentations-bucket-5 53.00% <ø> (-0.05%) ⬇️
instrumentations-bucket-6 55.60% <ø> (-0.05%) ⬇️
instrumentations-bucket-7 53.59% <ø> (-0.05%) ⬇️
instrumentations-bucket-8 54.63% <ø> (-0.05%) ⬇️
instrumentations-bucket-9 56.09% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-couchbase 48.17% <ø> (-0.05%) ⬇️
instrumentations-integration-esbuild 33.96% <ø> (ø)
llmobs-ai_anthropic_bedrock 57.72% <ø> (-0.04%) ⬇️
llmobs-bucket-1 56.99% <ø> (-0.04%) ⬇️
llmobs-openai 57.55% <ø> (-0.04%) ⬇️
llmobs-sdk 59.94% <ø> (-0.05%) ⬇️
llmobs-vertex-ai 54.20% <ø> (-0.05%) ⬇️
master-coverage 96.57% <100.00%> (?)
openfeature 54.61% <ø> (ø)
openfeature-unit 49.82% <ø> (-0.05%) ⬇️
platform-core_esbuild_instrumentations-misc 38.45% <ø> (-0.03%) ⬇️
platform-integration 62.31% <89.74%> (+0.07%) ⬆️
platform-shimmer_unit-guardrails_webpack 37.28% <ø> (-0.03%) ⬇️
plugins-bucket-0 53.17% <ø> (-0.05%) ⬇️
plugins-bucket-1 55.07% <ø> (ø)
plugins-bucket-11 55.59% <ø> (-0.05%) ⬇️
plugins-bucket-18 57.06% <ø> (-0.05%) ⬇️
plugins-bucket-19 55.37% <ø> (-0.03%) ⬇️
plugins-bucket-20 57.44% <ø> (-0.05%) ⬇️
plugins-bucket-4 53.84% <ø> (-0.05%) ⬇️
plugins-bullmq_cassandra_cookie 57.39% <ø> (-0.05%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.31% <ø> (-0.05%) ⬇️
plugins-fetch_fs_generic-pool 54.54% <ø> (+0.03%) ⬆️
plugins-google-cloud-pubsub_grpc_handlebars 59.86% <ø> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 55.85% <ø> (-0.05%) ⬇️
plugins-jest_knex_langgraph 51.66% <ø> (-0.05%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 53.43% <ø> (-0.03%) ⬇️
plugins-lodash_mariadb_memcached 54.20% <ø> (-0.05%) ⬇️
plugins-moleculer_mongodb_mongodb-core 57.28% <ø> (-0.05%) ⬇️
plugins-mongoose_multer_mysql 54.70% <ø> (-0.05%) ⬇️
plugins-mysql2_nats_node-serialize 56.20% <ø> (-0.05%) ⬇️
plugins-opensearch_passport-http_pino 55.05% <ø> (-0.05%) ⬇️
plugins-postgres_process_pug 54.28% <ø> (-0.05%) ⬇️
plugins-redis_router_sequelize 57.00% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-rhea_undici_url 57.02% <ø> (-0.03%) ⬇️
plugins-valkey_vm_winston 53.84% <ø> (-0.05%) ⬇️
plugins-ws 54.79% <ø> (-0.05%) ⬇️
profiling 58.19% <ø> (-0.05%) ⬇️
serverless-aws-sdk-aws-sdk 50.66% <ø> (-0.04%) ⬇️
serverless-aws-sdk-bedrockruntime 50.68% <ø> (-0.05%) ⬇️
serverless-aws-sdk-client 51.97% <ø> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.74% <ø> (-0.05%) ⬇️
serverless-aws-sdk-eventbridge 46.24% <ø> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.71% <ø> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.78% <ø> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.53% <ø> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.72% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.48% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sqs 55.91% <ø> (-0.05%) ⬇️
serverless-aws-sdk-stepfunctions 51.25% <ø> (-0.05%) ⬇️
serverless-aws-sdk-util 48.47% <ø> (-0.05%) ⬇️
serverless-bucket-0 55.22% <ø> (ø)
serverless-bucket-1 55.99% <ø> (-0.05%) ⬇️
test-optimization-cucumber 72.93% <ø> (+0.02%) ⬆️
test-optimization-cypress 66.33% <ø> (+0.01%) ⬆️
test-optimization-jest 73.89% <ø> (-0.05%) ⬇️
test-optimization-mocha 74.30% <ø> (+0.05%) ⬆️
test-optimization-playwright-playwright-atr 61.56% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-efd 61.75% <ø> (ø)
test-optimization-playwright-playwright-final-status 61.71% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-impacted-tests 61.43% <ø> (+0.16%) ⬆️
test-optimization-playwright-playwright-reporting 61.33% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-test-management 62.24% <ø> (-0.12%) ⬇️
test-optimization-playwright-playwright-test-span 61.47% <ø> (-0.07%) ⬇️
test-optimization-selenium 60.66% <ø> (-0.17%) ⬇️
test-optimization-testopt 59.15% <ø> (+0.08%) ⬆️
test-optimization-vitest 71.57% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BridgeAR
BridgeAR marked this pull request as ready for review July 10, 2026 12:56
@BridgeAR
BridgeAR requested a review from a team as a code owner July 10, 2026 12:56
@BridgeAR
BridgeAR requested review from khanayan123 and removed request for a team July 10, 2026 12:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/dd-trace/src/opentelemetry/tracer_provider.js
BridgeAR added 3 commits July 10, 2026 19:20
…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.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-07-10-otel-tracerprovider-span-processors branch from e24db82 to 2a16095 Compare July 10, 2026 17:26
@BridgeAR
BridgeAR merged commit 6b2d55f into master Jul 14, 2026
657 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-07-10-otel-tracerprovider-span-processors branch July 14, 2026 12:31
This was referenced Jul 14, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 14, 2026
…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.
juan-fernandez pushed a commit that referenced this pull request Jul 14, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants