-
Notifications
You must be signed in to change notification settings - Fork 361
feat(debugger): add Remote Enablement support #7137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: watson/DEBUG-4402/even-more-rc-split
Are you sure you want to change the base?
feat(debugger): add Remote Enablement support #7137
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## watson/DEBUG-4402/even-more-rc-split #7137 +/- ##
========================================================================
- Coverage 84.82% 84.68% -0.15%
========================================================================
Files 524 524
Lines 22217 22320 +103
========================================================================
+ Hits 18845 18901 +56
- Misses 3372 3419 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Overall package sizeSelf size: 4.38 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 |
This comment has been minimized.
This comment has been minimized.
BenchmarksBenchmark execution time: 2025-12-19 20:26:36 Comparing candidate commit f53bcac in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 291 metrics, 29 unstable metrics. |
0c5d4ad to
21edda2
Compare
84300df to
918975b
Compare
21edda2 to
5d6eabd
Compare
918975b to
137abe9
Compare
5d6eabd to
a412829
Compare
137abe9 to
041ef5b
Compare
a412829 to
bc7d261
Compare
bc7d261 to
91ba2c1
Compare
041ef5b to
573563d
Compare
ce9aa71 to
c2e520a
Compare
573563d to
152a63b
Compare
c2e520a to
f369517
Compare
152a63b to
408e3f5
Compare
ffd7ab2 to
3d91f59
Compare
Implements Remote Enablement (RE) for Dynamic Instrumentation/Live Debugger via APM_TRACING_MULTICONFIG. This also fixes a long standing issue, now allowing multiple APM_TRACING remote configurations to be received and merged with priority-based rules. Key Remote Config changes: - Add ApmTracingManager class for priority-based merging of multiple APM_TRACING configs (Service+Env > Service > Env > Cluster > Org) - Add APM_TRACING_MULTICONFIG, APM_TRACING_ENABLE_DYNAMIC_INSTRUMENTATION, APM_TRACING_ENABLE_CODE_ORIGIN, and APM_TRACING_ENABLE_LIVE_DEBUGGING capability flags - Implement field guarding in config.js #applyRemote() to adopt highest priority non-null value for each field
3d91f59 to
f53bcac
Compare
shatzi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, added some comments.
| /** | ||
| * @typedef {object} RemoteConfigOptions | ||
| * @property {boolean} [dynamic_instrumentation_enabled] - Enable Dynamic Instrumentation | ||
| * @property {boolean} [live_debugging_enabled] - Enable Live Debugging (deprecated alias) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't add exception_replay field. Because I assume it is not supported yet. Live debugging is also not used as it should enable trigger probes and capture code origin spans variables - see the spec for distributed debugger.
So, for now we only need to look at code origin and dynamic instrumentation flags.
| } | ||
| } | ||
|
|
||
| log.debug('[config/remote_config] Merged %d configs into lib_config', libConfigCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: if all libConfigs were null, we didn't merged anything, should we return {} or null.
Not sure if there is a difference,
| rc.setProductHandler('APM_TRACING', (action, conf) => { | ||
| // Debugger | ||
| rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_ENABLE_DYNAMIC_INSTRUMENTATION, true) | ||
| rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_ENABLE_LIVE_DEBUGGING, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one
|
|
||
| const rcClientLibConfigManager = new RCClientLibConfigManager(config.service, config.env) | ||
|
|
||
| rc.setProductHandler('APM_TRACING', (action, conf, configId) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this run on every config we get? this mean are calling config.updateRemoteConfig multiple times. Maybe there is a better way to only call updateRemoteConfig only once we receive all the configs. I assume we would get all of the relevant configs on the first request.
|
|
||
| const tracingRemoteConfig = require('./config/remote_config') | ||
| tracingRemoteConfig.enable(rc, config, this._enableOrDisableTracing.bind(this)) | ||
| tracingRemoteConfig.enable(rc, config, this._updateTracing.bind(this), this._updateDebugger.bind(this)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we choose this design where we pass multiple functions to handle a new config?
I’m hoping we can simplify this so we don’t have to update multiple files every time we add a new product that needs to react to config changes.
Maybe something like a subscriber pattern, or proxy.on('config-change', updateDebugger).
| this._config.configure({ ...this._config, llmobs: llmobsConfig }) | ||
| // TODO: It's not nice that it's copying the entire config object to just update the llmobs config. | ||
| // We should find a better way to do this. | ||
| this._config.updateOptions({ ...this._config, llmobs: llmobsConfig }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the config also include merged values from the remote config?
I’m wondering if there’s a bug where, when we copy the config, merged remote properties get converted into local options properties.

What does this PR do?
Implements Remote Enablement (RE) for Dynamic Instrumentation/Live Debugger via
APM_TRACING_MULTICONFIG.Key Remote Config changes:
RCClientLibConfigManagerclass for priority-based merging of multipleAPM_TRACINGconfigs (Service+Env > Service > Env > Cluster > Org)APM_TRACING_MULTICONFIG,APM_TRACING_ENABLE_DYNAMIC_INSTRUMENTATION,APM_TRACING_ENABLE_CODE_ORIGIN, andAPM_TRACING_ENABLE_LIVE_DEBUGGINGcapability flagsconfig.js#applyRemoteConfig()to adopt highest priority non-null value for each field per RFCconfig/remote_config.jsKey Debugger changes:
isStarted(),stop(),configure()) todebugger/index.jsfor dynamic controlMotivation
The Debugger (Dynamic Instrumentation/Live Debugging) needs to support Remote Enablement, allowing operators to dynamically enable, disable, or reconfigure the debugger without requiring service restarts.
This implementation follows the
APM_TRACING_MULTICONFIGRFC.