Skip to content

Conversation

@watson
Copy link
Collaborator

@watson watson commented Dec 17, 2025

What does this PR do?

Refactors remote config capability and handler registration to improve separation of concerns. Moves feature-specific remote config setup from a central location into their respective feature modules, following the same pattern already used by AppSec.

Key changes:

  • Creates config/remote_config.js for client library config capabilities (APM_TRACING_*)
  • Creates openfeature/remote_config.js for OpenFeature capabilities (FFE_FLAG_CONFIGURATION_RULES)
  • Renames RemoteConfigManagerRemoteConfig and remote_config/manager.jsremote_config/index.js
  • Simplifies proxy.js to instantiate RemoteConfig directly instead of through wrapper function

Motivation

Motivation

This refactoring establishes a clear pattern where each feature manages its own remote config capabilities and handlers together:

  • Core features (like APM tracing) → always registered
  • Optional features (like AppSec) → registered only when feature is enabled

OpenFeature is an exception to this pattern: it always registers the FFE_FLAG_CONFIGURATION_RULES capability (required by parametric tests since v5.72.0), but only registers its handler when config.experimental.flaggingProvider.enabled is true. This hybrid approach satisfies test requirements while keeping the experimental feature properly gated.

Additional Notes

Reviewing this PR:
The diff is large but mostly consists of code being moved between files. To review more easily:

  1. File renames (no logic changes, just find/replace):

    • remote_config/manager.jsremote_config/index.js
    • test/remote_config/manager.spec.jstest/remote_config/index.spec.js
    • Class RemoteConfigManagerRemoteConfig (throughout)
  2. New files with moved code:

    • config/remote_config.js - client library config capabilities moved from old remote_config/index.js + APM_TRACING handler moved from proxy.js
    • openfeature/remote_config.js - FFE capability + handler moved from proxy.js
  3. Modified files:

    • proxy.js - Removed old wrapper, now instantiates RemoteConfig directly; handlers moved to feature modules
    • test/proxy.spec.js - Updated imports and assertions to match new structure
  4. Assertion lib:

    • Replaced chai with node:assert/strict in remote_config tests for consistency

No functional changes to remote config behavior, purely structural refactoring.

@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Overall package size

Self size: 4.37 MB
Deduped: 5.19 MB
No deduping: 5.19 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@datadog-official

This comment has been minimized.

@pr-commenter
Copy link

pr-commenter bot commented Dec 17, 2025

Benchmarks

Benchmark execution time: 2026-01-08 13:43:04

Comparing candidate commit 43e0e1e in PR branch watson/DEBUG-4402/even-more-rc-split with baseline commit 85edbfa in branch master.

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

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 97.61905% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.54%. Comparing base (85edbfa) to head (43e0e1e).

Files with missing lines Patch % Lines
packages/dd-trace/src/remote_config/index.js 97.28% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7127      +/-   ##
==========================================
+ Coverage   84.53%   84.54%   +0.01%     
==========================================
  Files         528      529       +1     
  Lines       22538    22542       +4     
==========================================
+ Hits        19052    19058       +6     
+ Misses       3486     3484       -2     

☔ 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.

@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from 84300df to 918975b Compare December 18, 2025 08:36
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 8023afd to 05e2209 Compare December 18, 2025 08:36
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch 2 times, most recently from 137abe9 to 041ef5b Compare December 18, 2025 11:25
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 05e2209 to 6b3bd2e Compare December 19, 2025 17:38
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch 3 times, most recently from 152a63b to 408e3f5 Compare December 19, 2025 19:02
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 6b3bd2e to 69d7527 Compare December 19, 2025 19:02
@watson watson requested review from a team, BridgeAR and simon-id December 19, 2025 20:33
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 69d7527 to 4209c81 Compare January 6, 2026 10:28
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch 2 times, most recently from 8171673 to e501e3b Compare January 6, 2026 10:51
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 4209c81 to c12a2a8 Compare January 6, 2026 10:51
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from 40b1dcb to 6abe01f Compare January 7, 2026 07:54
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from a8d37ec to df5f680 Compare January 7, 2026 08:07
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from 6abe01f to 217d033 Compare January 7, 2026 08:07
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from df5f680 to 8d1145b Compare January 7, 2026 18:56
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch 2 times, most recently from 6dba9c6 to 2d7b45a Compare January 8, 2026 09:22
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 8d1145b to d1b1394 Compare January 8, 2026 09:22
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from 2d7b45a to 025cb92 Compare January 8, 2026 11:15
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from d1b1394 to 0ca9227 Compare January 8, 2026 11:15
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from 025cb92 to d9da38e Compare January 8, 2026 11:26
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch 2 times, most recently from 5be2cd4 to d054943 Compare January 8, 2026 11:49
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from d9da38e to 975b200 Compare January 8, 2026 11:49
@watson watson changed the base branch from watson/DEBUG-4402/split-rc-and-appsec to graphite-base/7127 January 8, 2026 12:19
Move remote config capability and handler registration from central location
to feature-specific modules for better separation of concerns.

Changes:
- Create tracing/remote_config.js for APM_TRACING_* capabilities and handler
- Create openfeature/remote_config.js for FFE_FLAG_CONFIGURATION_RULES capability
- Remove remote_config/index.js wrapper, instantiate RemoteConfig directly in proxy
- Rename RemoteConfigManager class to RemoteConfig
- Rename remote_config/manager.js to remote_config/index.js
- Replace chai with node:assert/strict in remote_config tests
- Use real implementations in proxy tests instead of stubbing

This creates a consistent pattern where features own their remote config setup:
- Core APM tracing → tracing/remote_config.js (always enabled)
- OpenFeature → openfeature/remote_config.js (conditional)
- AppSec → appsec/remote_config.js (conditional)
@watson watson force-pushed the graphite-base/7127 branch from d054943 to 85edbfa Compare January 8, 2026 12:48
@watson watson force-pushed the watson/DEBUG-4402/even-more-rc-split branch from 975b200 to a3b1125 Compare January 8, 2026 12:48
@watson watson changed the base branch from graphite-base/7127 to master January 8, 2026 12:48
@watson watson marked this pull request as ready for review January 8, 2026 12:57
}
}

request(this.getPayload(), options, (err, data, statusCode) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we cache this already? Potentially add a TODO entry for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean cache the result of this.getPayload(), or? Then we need to deal with cache invalidation as it can change from request to request, but it's doable. But I would say outside the scope of this PR as this code is just moved from the old packages/dd-trace/src/remote_config/manager.js file. I've added a TODO for now

@watson watson requested a review from BridgeAR January 8, 2026 13:38
@watson watson enabled auto-merge (squash) January 8, 2026 13:42
@watson watson merged commit d0cc613 into master Jan 8, 2026
794 checks passed
@watson watson deleted the watson/DEBUG-4402/even-more-rc-split branch January 8, 2026 13:57
@dd-octo-sts dd-octo-sts bot mentioned this pull request Jan 12, 2026
dd-octo-sts bot pushed a commit that referenced this pull request Jan 12, 2026
…les (#7127)

Move remote config capability and handler registration from central location
to feature-specific modules for better separation of concerns.

Changes:
- Create tracing/remote_config.js for APM_TRACING_* capabilities and handler
- Create openfeature/remote_config.js for FFE_FLAG_CONFIGURATION_RULES capability
- Remove remote_config/index.js wrapper, instantiate RemoteConfig directly in proxy
- Rename RemoteConfigManager class to RemoteConfig
- Rename remote_config/manager.js to remote_config/index.js
- Replace chai with node:assert/strict in remote_config tests
- Use real implementations in proxy tests instead of stubbing

This creates a consistent pattern where features own their remote config setup:
- Core APM tracing → tracing/remote_config.js (always enabled)
- OpenFeature → openfeature/remote_config.js (conditional)
- AppSec → appsec/remote_config.js (conditional)
nina9753 pushed a commit that referenced this pull request Jan 15, 2026
…les (#7127)

Move remote config capability and handler registration from central location
to feature-specific modules for better separation of concerns.

Changes:
- Create tracing/remote_config.js for APM_TRACING_* capabilities and handler
- Create openfeature/remote_config.js for FFE_FLAG_CONFIGURATION_RULES capability
- Remove remote_config/index.js wrapper, instantiate RemoteConfig directly in proxy
- Rename RemoteConfigManager class to RemoteConfig
- Rename remote_config/manager.js to remote_config/index.js
- Replace chai with node:assert/strict in remote_config tests
- Use real implementations in proxy tests instead of stubbing

This creates a consistent pattern where features own their remote config setup:
- Core APM tracing → tracing/remote_config.js (always enabled)
- OpenFeature → openfeature/remote_config.js (conditional)
- AppSec → appsec/remote_config.js (conditional)
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