dd-trace-rb
dd-trace-rb copied to clipboard
DEBUG-3700 more explicitly access active remote
What does this PR do?
Removes Datadog::Core::Remote.active_remote and friends and changes the callers of this method to use Datadog.send(:components, allow_initialization: false).
Motivation:
Making code that intends to read component state only do so, by passing allow_initialization: false option to Datadog.send(:components). The issue with unconditional initialization is described in https://github.com/DataDog/dd-trace-rb/pull/4619.
The code in this PR only acts when there is an active remote, and is not designed to initialize the tracer.
Change log entry None
Additional Notes: Related: #4641
How to test the change? Existing tests
Thank you for updating Change log entry section :clap:
Visited at: 2025-05-28 19:02:57 UTC
Datadog Report
Branch report: components-init-remote
Commit report: 1f72ca6
Test service: dd-trace-rb
:white_check_mark: 0 Failed, 21483 Passed, 1303 Skipped, 4m 1.21s Total Time
Benchmarks
Benchmark execution time: 2025-05-28 19:29:01
Comparing candidate commit 1f72ca6b0c2089f7957e6a9217205d43f095c2d5 in PR branch components-init-remote with baseline commit b76fbae39486553d62b2a157f3fe462ded0d5573 in branch master.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 39 metrics, 6 unstable metrics.