Skip to content

chore: replace getValueFromEnvSources calls with config usage#8084

Merged
BridgeAR merged 10 commits intomasterfrom
BridgeAR/2026-04-23-improve-configuration-access
Apr 24, 2026
Merged

chore: replace getValueFromEnvSources calls with config usage#8084
BridgeAR merged 10 commits intomasterfrom
BridgeAR/2026-04-23-improve-configuration-access

Conversation

@BridgeAR
Copy link
Copy Markdown
Member

The config should be used directly, otherwise we duplicate the work.

The config should be used directly, otherwise we duplicate the work.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

Overall package size

Self size: 5.56 MB
Deduped: 6.4 MB
No deduping: 6.4 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 66.07143% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.66%. Comparing base (ab1f2a8) to head (6512ed4).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...es/datadog-plugin-azure-event-hubs/src/producer.js 0.00% 8 Missing ⚠️
...s/datadog-plugin-azure-service-bus/src/producer.js 0.00% 4 Missing ⚠️
packages/datadog-plugin-vitest/src/index.js 0.00% 2 Missing ⚠️
packages/datadog-plugin-playwright/src/index.js 0.00% 1 Missing ⚠️
...c/ci-visibility/requests/upload-coverage-report.js 50.00% 1 Missing ⚠️
packages/dd-trace/src/llmobs/sdk.js 50.00% 1 Missing ⚠️
packages/dd-trace/src/proxy.js 0.00% 1 Missing ⚠️
packages/dd-trace/src/telemetry/send-data.js 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8084      +/-   ##
==========================================
- Coverage   73.74%   73.66%   -0.08%     
==========================================
  Files         782      782              
  Lines       36354    36316      -38     
==========================================
- Hits        26809    26753      -56     
- Misses       9545     9563      +18     
Flag Coverage Δ
aiguard-macos 36.51% <50.00%> (-0.17%) ⬇️
aiguard-ubuntu 36.62% <50.00%> (-0.17%) ⬇️
aiguard-windows 36.42% <50.00%> (-0.17%) ⬇️
apm-capabilities-tracing-macos 47.99% <64.28%> (-0.44%) ⬇️
apm-capabilities-tracing-ubuntu 48.06% <64.28%> (-0.40%) ⬇️
apm-capabilities-tracing-windows 47.85% <64.28%> (-0.36%) ⬇️
apm-integrations-child-process 36.17% <50.00%> (-0.10%) ⬇️
apm-integrations-couchbase-18 35.17% <50.00%> (-0.09%) ⬇️
apm-integrations-couchbase-eol 35.25% <50.00%> (-0.09%) ⬇️
apm-integrations-oracledb 35.22% <50.00%> (-0.09%) ⬇️
appsec-express 52.85% <50.00%> (-0.12%) ⬇️
appsec-fastify 49.32% <50.00%> (-0.11%) ⬇️
appsec-graphql 49.68% <57.14%> (-0.12%) ⬇️
appsec-kafka 42.11% <50.00%> (-0.14%) ⬇️
appsec-ldapjs 41.43% <50.00%> (-0.13%) ⬇️
appsec-lodash 41.46% <50.00%> (-0.13%) ⬇️
appsec-macos 56.92% <64.28%> (-0.10%) ⬇️
appsec-mongodb-core 45.76% <50.00%> (-0.14%) ⬇️
appsec-mongoose 46.64% <50.00%> (-0.13%) ⬇️
appsec-mysql 48.81% <50.00%> (-0.11%) ⬇️
appsec-node-serialize 40.63% <50.00%> (-0.13%) ⬇️
appsec-passport 44.62% <50.00%> (-0.14%) ⬇️
appsec-postgres 48.40% <50.00%> (-0.12%) ⬇️
appsec-sourcing 40.12% <50.00%> (-0.13%) ⬇️
appsec-stripe 42.35% <50.00%> (-0.25%) ⬇️
appsec-template 40.79% <50.00%> (-0.13%) ⬇️
appsec-ubuntu 56.99% <64.28%> (-0.10%) ⬇️
appsec-windows 56.81% <64.28%> (-0.10%) ⬇️
instrumentations-instrumentation-bluebird 29.86% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-body-parser 37.76% <50.00%> (-0.09%) ⬇️
instrumentations-instrumentation-child_process 35.54% <50.00%> (-0.10%) ⬇️
instrumentations-instrumentation-cookie-parser 31.78% <42.85%> (-0.09%) ⬇️
instrumentations-instrumentation-express 32.00% <42.85%> (-0.09%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 31.90% <42.85%> (-0.09%) ⬇️
instrumentations-instrumentation-express-session 37.39% <50.00%> (-0.09%) ⬇️
instrumentations-instrumentation-fs 29.53% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-generic-pool 30.88% <0.00%> (-0.04%) ⬇️
instrumentations-instrumentation-http 37.00% <50.00%> (-0.09%) ⬇️
instrumentations-instrumentation-knex 29.83% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-light-my-request 37.33% <50.00%> (-0.09%) ⬇️
instrumentations-instrumentation-mongoose 30.92% <42.85%> (-0.11%) ⬇️
instrumentations-instrumentation-multer 37.53% <50.00%> (-0.09%) ⬇️
instrumentations-instrumentation-mysql2 35.52% <50.00%> (-0.09%) ⬇️
instrumentations-instrumentation-passport 41.27% <50.00%> (-0.08%) ⬇️
instrumentations-instrumentation-passport-http 40.96% <50.00%> (-0.08%) ⬇️
instrumentations-instrumentation-passport-local 41.46% <50.00%> (-0.08%) ⬇️
instrumentations-instrumentation-pg 35.04% <50.00%> (-0.10%) ⬇️
instrumentations-instrumentation-promise 29.79% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-promise-js 29.80% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-q 29.83% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-url 29.79% <42.85%> (-0.10%) ⬇️
instrumentations-instrumentation-when 29.81% <42.85%> (-0.10%) ⬇️
llmobs-ai 38.49% <50.00%> (-0.09%) ⬇️
llmobs-anthropic 37.94% <50.00%> (-0.09%) ⬇️
llmobs-bedrock 37.17% <53.33%> (-0.08%) ⬇️
llmobs-google-genai 37.61% <50.00%> (-0.08%) ⬇️
llmobs-langchain 37.07% <46.66%> (-0.17%) ⬇️
llmobs-openai 41.31% <50.00%> (-0.08%) ⬇️
llmobs-vertex-ai 37.80% <50.00%> (-0.09%) ⬇️
platform-core 30.03% <ø> (+0.12%) ⬆️
platform-esbuild 32.83% <ø> (+0.11%) ⬆️
platform-instrumentations-misc 40.01% <ø> (-0.07%) ⬇️
platform-shimmer 35.72% <ø> (+0.10%) ⬆️
platform-unit-guardrails 31.39% <ø> (+0.11%) ⬆️
platform-webpack 20.78% <0.00%> (-0.02%) ⬇️
plugins-azure-durable-functions 25.36% <ø> (+0.10%) ⬆️
plugins-azure-event-hubs 25.51% <ø> (+0.10%) ⬆️
plugins-azure-service-bus 24.92% <ø> (+0.10%) ⬆️
plugins-bullmq 40.83% <50.00%> (-0.09%) ⬇️
plugins-cassandra 35.36% <50.00%> (-0.09%) ⬇️
plugins-cookie 26.47% <ø> (+0.10%) ⬆️
plugins-cookie-parser 26.28% <ø> (+0.10%) ⬆️
plugins-crypto 25.70% <ø> (+0.14%) ⬆️
plugins-dd-trace-api 35.48% <50.00%> (-0.10%) ⬇️
plugins-express-mongo-sanitize 26.42% <ø> (+0.10%) ⬆️
plugins-express-session 26.24% <ø> (+0.10%) ⬆️
plugins-fastify 39.38% <50.00%> (-0.15%) ⬇️
plugins-fetch 35.87% <50.00%> (-0.09%) ⬇️
plugins-fs 35.76% <50.00%> (-0.10%) ⬇️
plugins-generic-pool 25.40% <ø> (+0.10%) ⬆️
plugins-google-cloud-pubsub 43.13% <50.00%> (-0.08%) ⬇️
plugins-grpc 38.14% <50.00%> (-0.09%) ⬇️
plugins-handlebars 26.46% <ø> (+0.10%) ⬆️
plugins-hapi 37.38% <50.00%> (-0.09%) ⬇️
plugins-hono 37.62% <50.00%> (-0.09%) ⬇️
plugins-ioredis 35.82% <50.00%> (-0.09%) ⬇️
plugins-knex 26.14% <ø> (+0.10%) ⬆️
plugins-langgraph 35.16% <50.00%> (-0.08%) ⬇️
plugins-ldapjs 24.02% <ø> (+0.10%) ⬆️
plugins-light-my-request 25.88% <ø> (+0.10%) ⬆️
plugins-limitd-client 30.09% <42.85%> (-0.10%) ⬇️
plugins-lodash 25.47% <ø> (+0.10%) ⬆️
plugins-mariadb 36.69% <50.00%> (-0.09%) ⬇️
plugins-memcached 35.47% <50.00%> (-0.10%) ⬇️
plugins-microgateway-core 36.46% <50.00%> (-0.09%) ⬇️
plugins-modelcontextprotocol-sdk 34.40% <50.00%> (-0.10%) ⬇️
plugins-moleculer 38.16% <50.00%> (-0.09%) ⬇️
plugins-mongodb 36.62% <50.00%> (+<0.01%) ⬆️
plugins-mongodb-core 36.26% <50.00%> (-0.11%) ⬇️
plugins-mongoose 36.24% <50.00%> (+<0.01%) ⬆️
plugins-multer 26.24% <ø> (+0.10%) ⬆️
plugins-mysql 36.55% <50.00%> (-0.09%) ⬇️
plugins-mysql2 36.53% <50.00%> (-0.09%) ⬇️
plugins-node-serialize 26.51% <ø> (+0.10%) ⬆️
plugins-opensearch 35.12% <50.00%> (-0.09%) ⬇️
plugins-passport-http 26.30% <ø> (+0.10%) ⬆️
plugins-postgres 34.51% <50.00%> (-0.09%) ⬇️
plugins-process 25.70% <ø> (+0.14%) ⬆️
plugins-pug 26.47% <ø> (+0.10%) ⬆️
plugins-redis 36.02% <50.00%> (-0.09%) ⬇️
plugins-router 40.03% <50.00%> (-0.09%) ⬇️
plugins-sequelize 25.18% <ø> (+0.10%) ⬆️
plugins-test-and-upstream-amqp10 35.79% <50.00%> (-0.09%) ⬇️
plugins-test-and-upstream-amqplib 40.98% <50.00%> (-0.09%) ⬇️
plugins-test-and-upstream-apollo 36.62% <50.00%> (-0.08%) ⬇️
plugins-test-and-upstream-avsc 35.55% <50.00%> (-0.17%) ⬇️
plugins-test-and-upstream-bunyan 31.24% <42.85%> (-0.10%) ⬇️
plugins-test-and-upstream-connect 37.97% <50.00%> (-0.09%) ⬇️
plugins-test-and-upstream-graphql 37.32% <57.14%> (-0.09%) ⬇️
plugins-test-and-upstream-koa 37.58% <50.00%> (-0.09%) ⬇️
plugins-test-and-upstream-protobufjs 35.76% <50.00%> (-0.17%) ⬇️
plugins-test-and-upstream-rhea 41.08% <50.00%> (-0.06%) ⬇️
plugins-undici 36.63% <50.00%> (-0.09%) ⬇️
plugins-url 25.70% <ø> (+0.14%) ⬆️
plugins-valkey 35.50% <50.00%> (-0.09%) ⬇️
plugins-vm 25.70% <ø> (+0.14%) ⬆️
plugins-winston 31.68% <42.85%> (-0.10%) ⬇️
plugins-ws 39.11% <50.00%> (-0.09%) ⬇️
profiling-macos 37.96% <50.00%> (-0.16%) ⬇️
profiling-ubuntu 38.13% <50.00%> (-0.16%) ⬇️
profiling-windows 39.49% <64.28%> (-0.15%) ⬇️
serverless-azure-functions-client 25.25% <ø> (+0.10%) ⬆️
serverless-azure-functions-eventhubs 25.25% <ø> (+0.10%) ⬆️
serverless-azure-functions-servicebus 25.25% <ø> (+0.10%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Apr 23, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 56.14%
Overall Coverage: 68.04% (-0.03%)

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

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 23, 2026

Benchmarks

Benchmark execution time: 2026-04-24 14:27:09

Comparing candidate commit 6512ed4 in PR branch BridgeAR/2026-04-23-improve-configuration-access with baseline commit ab1f2a8 in branch master.

Found 25 performance improvements and 4 performance regressions! Performance is the same for 1312 metrics, 103 unstable metrics.

scenario:encoders-0.5-22

  • 🟥 cpu_user_time [+21.500ms; +36.143ms] or [+7.370%; +12.390%]
  • 🟥 execution_time [+25.108ms; +38.017ms] or [+6.622%; +10.026%]

scenario:encoders-0.5-24

  • 🟥 cpu_user_time [+17.368ms; +24.886ms] or [+6.539%; +9.370%]
  • 🟥 execution_time [+20.893ms; +25.922ms] or [+5.936%; +7.364%]

scenario:runtime-metrics-with-runtime-metrics-22

  • 🟩 max_rss_usage [-6.945MB; -6.227MB] or [-7.759%; -6.957%]

scenario:spans-finish-immediately-18

  • 🟩 cpu_user_time [-103.889ms; -98.782ms] or [-19.193%; -18.250%]
  • 🟩 execution_time [-104.715ms; -101.361ms] or [-17.796%; -17.226%]
  • 🟩 instructions [-599.7M instructions; -593.2M instructions] or [-22.931%; -22.680%]

scenario:spans-finish-immediately-20

  • 🟩 cpu_user_time [-89.301ms; -84.804ms] or [-19.679%; -18.688%]
  • 🟩 execution_time [-90.094ms; -87.451ms] or [-17.994%; -17.466%]
  • 🟩 instructions [-559.1M instructions; -553.1M instructions] or [-24.413%; -24.153%]

scenario:spans-finish-immediately-22

  • 🟩 cpu_user_time [-88.278ms; -84.230ms] or [-19.193%; -18.313%]
  • 🟩 execution_time [-90.054ms; -87.467ms] or [-17.648%; -17.141%]
  • 🟩 instructions [-555.4M instructions; -546.7M instructions] or [-23.799%; -23.424%]

scenario:spans-finish-immediately-24

  • 🟩 cpu_user_time [-80.835ms; -76.687ms] or [-18.945%; -17.973%]
  • 🟩 execution_time [-81.415ms; -78.172ms] or [-16.958%; -16.282%]
  • 🟩 instructions [-543.4M instructions; -535.1M instructions] or [-25.457%; -25.069%]

scenario:spans-finish-later-18

  • 🟩 cpu_user_time [-90.896ms; -82.369ms] or [-10.752%; -9.743%]
  • 🟩 execution_time [-91.975ms; -85.468ms] or [-9.347%; -8.686%]
  • 🟩 instructions [-629.4M instructions; -548.0M instructions] or [-17.687%; -15.398%]

scenario:spans-finish-later-20

  • 🟩 cpu_user_time [-92.991ms; -84.430ms] or [-11.866%; -10.774%]
  • 🟩 execution_time [-93.112ms; -86.441ms] or [-10.198%; -9.468%]
  • 🟩 instructions [-555.1M instructions; -498.7M instructions] or [-17.785%; -15.977%]

scenario:spans-finish-later-22

  • 🟩 cpu_user_time [-94.276ms; -84.478ms] or [-12.244%; -10.972%]
  • 🟩 execution_time [-95.591ms; -85.882ms] or [-10.570%; -9.496%]
  • 🟩 instructions [-605.2M instructions; -519.1M instructions] or [-18.892%; -16.202%]

scenario:spans-finish-later-24

  • 🟩 cpu_user_time [-93.560ms; -81.900ms] or [-13.095%; -11.463%]
  • 🟩 execution_time [-96.791ms; -85.637ms] or [-10.884%; -9.629%]
  • 🟩 instructions [-626.0M instructions; -549.4M instructions] or [-21.208%; -18.611%]

The previous full-close between loads was too aggressive: tests that
load a base set of plugins once (e.g., the IAST helper loads `http`)
and then call `agent.load('<other>')` per test relied on the first
load's subscriptions remaining active. Disabling everything broke
those (AppSec/ldapjs).

Now only disable old instances of the plugins being re-loaded. That
still clears the stale `_tracerConfig` for tests that toggle env
between loads (aws-sdk kinesis Disabled case) while leaving unrelated
plugins alone.

Made-with: Cursor
Disabled-at-runtime scenarios (tests toggle
`DD_TRACE_AWS_SDK_<service>_ENABLED=false` after the tracer is already
running) can't be satisfied by reading from the Config singleton, which
is frozen at init. Revert the previous migration and restore the
`getValueFromEnvSources` read for now.

Also revert the speculative plugin-cleanup that was added to
agent.load(): it breaks tests that rely on nested loads sharing an
outer load's plugin subscriptions (e.g., the IAST helper loads 'http'
once, then per-test loads other plugins).

Made-with: Cursor
The Config-backed lookup is behaviorally identical, but it seems to
disturb the mongodb test timing enough that the heartbeat span
occasionally arrives before the insert. Revert to the original
fallthrough to unblock CI; the underlying test flakiness can be
addressed separately.

Made-with: Cursor
@BridgeAR BridgeAR marked this pull request as ready for review April 23, 2026 21:30
@BridgeAR BridgeAR requested review from a team as code owners April 23, 2026 21:30
@BridgeAR BridgeAR requested review from ida613 and lym953 and removed request for a team April 23, 2026 21:30
rochdev
rochdev previously approved these changes Apr 23, 2026
@BridgeAR BridgeAR enabled auto-merge (squash) April 23, 2026 21:38
Copy link
Copy Markdown

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

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: af1d6a258f

ℹ️ 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/telemetry/send-data.js Outdated
@BridgeAR BridgeAR disabled auto-merge April 23, 2026 21:39
rochdev
rochdev previously approved these changes Apr 23, 2026
@BridgeAR BridgeAR enabled auto-merge (squash) April 23, 2026 22:14
@BridgeAR BridgeAR marked this pull request as draft April 23, 2026 23:56
auto-merge was automatically disabled April 23, 2026 23:56

Pull request was converted to draft

@BridgeAR BridgeAR marked this pull request as ready for review April 24, 2026 14:30
@BridgeAR BridgeAR merged commit c0ae719 into master Apr 24, 2026
1079 of 1086 checks passed
@BridgeAR BridgeAR deleted the BridgeAR/2026-04-23-improve-configuration-access branch April 24, 2026 16:45
dd-octo-sts Bot pushed a commit that referenced this pull request Apr 25, 2026
The config should be used directly, otherwise we duplicate the work.

This improves runtime in some spots slightly as seen in the benchmarks.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Apr 25, 2026
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.

2 participants