refactor(config): drop internalPropertyName from supported-configurations#9112
Conversation
…ions internalPropertyName carried a hand-maintained runtime property path that diverged from the canonical env name, so the same configuration was named twice and the two could drift. Remove the field and derive the runtime path the same way the rest of the table does. 1. The nine Test Optimization toggles move under a `testOptimization` namespace, so each path is `testOptimization.DD_CIVISIBILITY_*` / `testOptimization.DD_TEST_*` derived from the canonical name. 2. `apiKey`, `tracing`, and `scope` have no namespace, so they fall back to the canonical env name (`config.DD_API_KEY`, `config.DD_TRACE_ENABLED`, `config.DD_TRACE_SCOPE`); every runtime consumer is renamed to match. 3. `queryStringObfuscation` and `resourceRenamingEnabled` are per-integration options forwarded to plugins by `#getSharedConfig`. That single hand-off now reads the canonical name and still forwards the unchanged per-plugin key, so no `index.d.ts` or plugin-facing surface changes. The canonical name telemetry reports is unchanged; only the property path the config object exposes moves. The remote-config `tracing_enabled` mapping now targets `DD_TRACE_ENABLED`, and the same-name table entries resolve their property via `entry.property ?? name` so `#applyOptions` keeps writing the canonical key. Drive-by fix: * Drop the duplicate `enabled` leaf left in the exporting-pipeline and llmobs-span-processor benchmarks after the previous namespace migration; the span processors read the canonical key, so `enabled` was dead.
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 5f4f1e9 | Docs | Datadog PR Page | Give us feedback! |
Overall package sizeSelf size: 6.4 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 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 |
BenchmarksBenchmark execution time: 2026-06-27 13:58:54 Comparing candidate commit 5f4f1e9 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2255 metrics, 31 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9112 +/- ##
=======================================
Coverage 93.69% 93.69%
=======================================
Files 889 889
Lines 50856 50859 +3
Branches 11830 11832 +2
=======================================
+ Hits 47647 47651 +4
+ Misses 3209 3208 -1
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:
|
…-opt configs
Two follow-on cleanups to the internalPropertyName removal:
1. Consumers that aliased the canonical name back to the old short name
(`const { DD_API_KEY: apiKey }`, `DD_TRACE_ENABLED: tracing`, the
`isTestDynamicInstrumentationEnabled` locals in the exporters) now use the
canonical name directly, so the property name is the same from the config
object through to the call site. In plugin_manager the destructure reads the
canonical name and the plugin-facing key (`queryStringObfuscation`,
`resourceRenamingEnabled`) is applied only at the sharedConfig boundary,
matching the existing `middlewareTracingEnabled` -> `middleware` shape.
2. Eight more Test Optimization configs move under the `testOptimization`
namespace: AGENTLESS_ENABLED, AGENTLESS_URL, AUTO_INSTRUMENTATION_PROVIDER,
DANGEROUSLY_FORCE_COVERAGE, DANGEROUSLY_FORCE_TEST_SKIPPING,
GIT_UNSHALLOW_ENABLED, MANUAL_API_ENABLED, RUM_FLUSH_WAIT_MILLIS. Their
runtime consumers move to `config.testOptimization.DD_CIVISIBILITY_*`.
DD_TEST_SESSION_NAME stays top-level: it reaches `getTestSessionName` through
both the plugin sharedConfig (flat key) and, for the non-CiPlugin cypress
exporter, the raw tracer Config, so namespacing it would split the two call
paths. The remaining bare CI-vis entries are env-only (read before the Config
exists, or unused), where a namespace changes nothing observable.
Move the last six Test Optimization entries under the `testOptimization` namespace: DD_CIVISIBILITY_ENABLED, DD_CIVISIBILITY_TEST_COMMAND, DD_CIVISIBILITY_TEST_MODULE_ID, DD_CIVISIBILITY_TEST_SESSION_ID, DD_TEST_FLEET_CONFIG_PATH, DD_TEST_LOCAL_CONFIG_PATH. These have no `config.*` property consumers: the stable-config paths and DD_CIVISIBILITY_ENABLED are read from the environment by canonical name (which a namespace leaves untouched), and the three test-id entries are unused. The change is therefore JSON + regenerated types only, finishing the namespace so every CI-vis entry is grouped consistently.
CiPlugin.configure receives the per-plugin sharedConfig built by PluginManager#getSharedConfig, not the tracer Config, so it has no `testOptimization` namespace. Reading `config.testOptimization .DD_TEST_FAILED_TEST_REPLAY_ENABLED` there threw `Cannot read properties of undefined`, crashing tracer init for every plugin and integration suite that loads a CI plugin. Read the flat `isTestDynamicInstrumentationEnabled` key the shared config actually forwards, as before the rename.
…ion namespace #getSharedConfig reads `testOptimization.DD_TEST_FAILED_TEST_REPLAY_ENABLED`, so the spec's `makeTracerConfig` stand-in must carry that namespace object the real Config always builds; without it the shared-config build threw and every configure-spy assertion failed. Also feed the query-string obfuscation override through its canonical tracer-config key (`DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP`); the plugin-facing `queryStringObfuscation` key the shared config forwards is unchanged.
There was a problem hiding this comment.
More details
The risky asymmetry in this rename — CiPlugin.configure receives the flat per-plugin sharedConfig, which has no testOptimization namespace, so reading config.testOptimization.* there crashed tracer init — was already caught and fixed earlier in the stack (commit c4e375c, now reading the flat isTestDynamicInstrumentationEnabled that getSharedConfig forwards). Every remaining config.testOptimization.* reader receives the namespaced tracer config, and the env-var, remote-config tracing_enabled, and plugin-forwarded read paths all resolve to the renamed properties.
📊 Validated against 12 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 5f4f1e9 · What is Autotest? · Any feedback? Reach out in #autotest
juan-fernandez
left a comment
There was a problem hiding this comment.
ok from test optimization's perspective
…9112) `internalPropertyName` made each supported config carry a second hand-maintained runtime path next to its canonical env name. Drop that alias and derive the config-object path from the canonical name, with Test Optimization entries grouped under `testOptimization` and top-level entries using their canonical key directly. The plugin shared-config boundary still forwards the existing per-plugin keys, including the flat dynamic-instrumentation flag `CiPlugin.configure` receives; plugins do not receive the namespaced tracer config. Drive-by fix: * Drop duplicate benchmark `enabled` leaves left behind by the previous namespace migration.
…9112) `internalPropertyName` made each supported config carry a second hand-maintained runtime path next to its canonical env name. Drop that alias and derive the config-object path from the canonical name, with Test Optimization entries grouped under `testOptimization` and top-level entries using their canonical key directly. The plugin shared-config boundary still forwards the existing per-plugin keys, including the flat dynamic-instrumentation flag `CiPlugin.configure` receives; plugins do not receive the namespaced tracer config. Drive-by fix: * Drop duplicate benchmark `enabled` leaves left behind by the previous namespace migration.
Summary
internalPropertyNamecarried a hand-maintained runtime property path that diverged from the canonical env name, so the same configuration was named twice and the two could drift. This removes the field entirely and derives the runtime path the way the rest of the table already does.testOptimizationnamespace, so each path istestOptimization.DD_CIVISIBILITY_*/testOptimization.DD_TEST_*derived from the canonical name.apiKey,tracing, andscopehave no namespace and fall back to the canonical env name (config.DD_API_KEY,config.DD_TRACE_ENABLED,config.DD_TRACE_SCOPE); every runtime consumer is renamed to match.queryStringObfuscationandresourceRenamingEnabledare per-integration options forwarded to plugins byPluginManager#getSharedConfig. That single hand-off now reads the canonical name and still forwards the unchanged per-plugin key, so the plugin-facing surface andindex.d.tsare untouched.Why
The canonical name telemetry reports is unchanged; only the property path the config object exposes moves. Two follow-on details keep behaviour identical:
tracing_enabledmapping now targetsDD_TRACE_ENABLED, and#applyOptionsresolves same-name table entries viaentry.property ?? nameso the canonical key is still written.generated-config-types.d.tsis regenerated from the new shape.Drive-by
enabledleaf left in theexporting-pipelineandllmobs-span-processorbenchmarks after the previous namespace migration; the span processors read the canonical key, soenabledwas dead.Test plan
packages/dd-trace/test/config/index.spec.js(new guard: nointernalPropertyNameremains; renamed property assertions)ci-visibility-exporter,agentless,agent-proxy) with thetestOptimizationnamespace stand-insproxy,span_processor,telemetry/send-data,aiguard, and the llmobs writer specs for theDD_API_KEY/DD_TRACE_ENABLEDrenames