Skip to content

Commit 65b0a10

Browse files
committed
delete active_remote
1 parent b76fbae commit 65b0a10

File tree

4 files changed

+7
-27
lines changed

4 files changed

+7
-27
lines changed

lib/datadog/core/remote.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ module Datadog
44
module Core
55
# Module to interact with core remote component
66
module Remote
7-
class << self
8-
def active_remote
9-
remote
10-
end
11-
12-
private
13-
14-
def components
15-
Datadog.send(:components)
16-
end
17-
18-
def remote
19-
components.remote
20-
end
21-
end
227
end
238
end
249
end

lib/datadog/core/remote/tie.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ module Tie
1111
)
1212

1313
def self.boot
14-
return if Datadog::Core::Remote.active_remote.nil?
14+
active_remote = Datadog.send(:components, allow_initialization: false).remote
15+
return if active_remote.nil?
1516

1617
barrier = nil
1718

1819
t = Datadog::Core::Utils::Time.measure do
19-
barrier = Datadog::Core::Remote.active_remote.barrier(:once)
20+
barrier = active_remote.barrier(:once)
2021
end
2122

2223
# steep does not permit the next line due to

lib/datadog/core/remote/tie/tracing.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ def self.tag(boot, span)
1313
return if boot.nil?
1414
return if span.nil?
1515

16-
return if Datadog::Core::Remote.active_remote.nil?
16+
active_remote = Datadog.send(:components, allow_initialization: false).remote
17+
return if active_remote.nil?
1718

1819
# TODO: this is not thread-consistent
19-
ready = Datadog::Core::Remote.active_remote.healthy
20+
ready = active_remote.healthy
2021
status = ready ? 'ready' : 'disconnected'
2122

22-
span.set_tag('_dd.rc.client_id', Datadog::Core::Remote.active_remote.client.id)
23+
span.set_tag('_dd.rc.client_id', active_remote.client.id)
2324
span.set_tag('_dd.rc.status', status)
2425

2526
if boot.barrier != :pass

sig/datadog/core/remote.rbs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
module Datadog
22
module Core
33
module Remote
4-
def self.active_remote: () -> Datadog::Core::Remote::Component
5-
6-
private
7-
8-
def self.components: () -> Datadog::Core::Configuration::Components
9-
10-
def self.remote: () -> Datadog::Core::Remote::Component
114
end
125
end
136
end

0 commit comments

Comments
 (0)