refactor(config): modernize Config class structure and extract stateless methods#7408
refactor(config): modernize Config class structure and extract stateless methods#7408
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Overall package sizeSelf size: 4.49 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.3 | 76.87 kB | 808.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7408 +/- ##
==========================================
- Coverage 85.83% 80.56% -5.28%
==========================================
Files 518 731 +213
Lines 22376 31236 +8860
==========================================
+ Hits 19207 25165 +5958
- Misses 3169 6071 +2902 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
24092ac to
c02431b
Compare
BenchmarksBenchmark execution time: 2026-02-02 07:21:59 Comparing candidate commit 3f99c0c in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 231 metrics, 29 unstable metrics. |
BridgeAR
left a comment
There was a problem hiding this comment.
I do not have a strong opinion on these improvements, while they should all be fine.
…ess methods (#7408) * Move stateless methods outside of Config class * Group private/public methods in Config class * Use proper private methods instead of underscore-prefix * Remove whitespace * Move functions below Config class + export above * Capitalize constants + use Maps for map-like objects * Use node: prefix for core modules * Group imports correctly * Move configInstance variable to the top
…ess methods (#7408) * Move stateless methods outside of Config class * Group private/public methods in Config class * Use proper private methods instead of underscore-prefix * Remove whitespace * Move functions below Config class + export above * Capitalize constants + use Maps for map-like objects * Use node: prefix for core modules * Group imports correctly * Move configInstance variable to the top
…ess methods (#7408) * Move stateless methods outside of Config class * Group private/public methods in Config class * Use proper private methods instead of underscore-prefix * Remove whitespace * Move functions below Config class + export above * Capitalize constants + use Maps for map-like objects * Use node: prefix for core modules * Group imports correctly * Move configInstance variable to the top
…ess methods (#7408) * Move stateless methods outside of Config class * Group private/public methods in Config class * Use proper private methods instead of underscore-prefix * Remove whitespace * Move functions below Config class + export above * Capitalize constants + use Maps for map-like objects * Use node: prefix for core modules * Group imports correctly * Move configInstance variable to the top

What does this PR do?
Refactor the
Configclass inpackages/dd-trace/src/config/index.jsto improve code organization:this) outside theConfigclass as standalone functions_method) with proper ES2022 private class fields (#method)Mapinstances where they were used as key-value stores (OTEL_DD_ENV_MAPPING,TELEMETRY_COUNTERS)SCREAMING_SNAKE_CASEconvention (RUNTIME_ID,NAMING_VERSIONS, etc.)node:prefix to Node.js core module imports (fs,os,url,path) per modern conventionsAll changes are purely structural with no behavioral modifications.
Motivation
The
Configclass has grown organically over time and accumulated methods that don't actually need instance access. This refactoring:Additional Notes