diff --git a/lib/datadog/tracing/contrib/http/circuit_breaker.rb b/lib/datadog/tracing/contrib/http/circuit_breaker.rb index 29c889ffbc0..11f1db27d65 100644 --- a/lib/datadog/tracing/contrib/http/circuit_breaker.rb +++ b/lib/datadog/tracing/contrib/http/circuit_breaker.rb @@ -27,17 +27,6 @@ def internal_request?(request) !!(request[Datadog::Core::Transport::Ext::HTTP::HEADER_META_TRACER_VERSION] || request[Datadog::Core::Transport::Ext::HTTP::HEADER_DD_INTERNAL_UNTRACED_REQUEST]) end - - def should_skip_distributed_tracing?(client_config, trace) - unless Datadog.configuration.tracing.apm.enabled - return true unless trace - return true if trace.non_billing_reject? - end - - return !client_config[:distributed_tracing] if client_config && client_config.key?(:distributed_tracing) - - !Datadog.configuration.tracing[:http][:distributed_tracing] - end end end end diff --git a/sig/datadog/tracing/contrib/http/circuit_breaker.rbs b/sig/datadog/tracing/contrib/http/circuit_breaker.rbs index 170ff4884c2..bc1a05213ff 100644 --- a/sig/datadog/tracing/contrib/http/circuit_breaker.rbs +++ b/sig/datadog/tracing/contrib/http/circuit_breaker.rbs @@ -5,8 +5,6 @@ module Datadog module CircuitBreaker def should_skip_tracing?: (untyped request) -> (true | false) def internal_request?: (untyped request) -> bool - - def should_skip_distributed_tracing?: (untyped client_config, Datadog::Tracing::TraceOperation trace) -> bool end end end diff --git a/sig/datadog/tracing/contrib/httpclient/instrumentation.rbs b/sig/datadog/tracing/contrib/httpclient/instrumentation.rbs index 1225e26961b..ce0f5210536 100644 --- a/sig/datadog/tracing/contrib/httpclient/instrumentation.rbs +++ b/sig/datadog/tracing/contrib/httpclient/instrumentation.rbs @@ -23,8 +23,6 @@ module Datadog def logger: () -> untyped - def should_skip_distributed_tracing?: (untyped client_config, Datadog::Tracing::TraceOperation trace) -> bool - def set_analytics_sample_rate: (untyped span, untyped request_options) -> (nil | untyped) end end diff --git a/sig/datadog/tracing/contrib/httprb/instrumentation.rbs b/sig/datadog/tracing/contrib/httprb/instrumentation.rbs index 4d6035149ae..16a4ba2133f 100644 --- a/sig/datadog/tracing/contrib/httprb/instrumentation.rbs +++ b/sig/datadog/tracing/contrib/httprb/instrumentation.rbs @@ -23,8 +23,6 @@ module Datadog def logger: () -> untyped - def should_skip_distributed_tracing?: (untyped client_config, Datadog::Tracing::TraceOperation trace) -> bool - def set_analytics_sample_rate: (untyped span, untyped request_options) -> (nil | untyped) end end diff --git a/spec/datadog/tracing/contrib/http/circuit_breaker_spec.rb b/spec/datadog/tracing/contrib/http/circuit_breaker_spec.rb index 73923293695..4d656c7ed87 100644 --- a/spec/datadog/tracing/contrib/http/circuit_breaker_spec.rb +++ b/spec/datadog/tracing/contrib/http/circuit_breaker_spec.rb @@ -91,70 +91,4 @@ end end end - - describe '#should_skip_distributed_tracing?' do - subject(:should_skip_distributed_tracing?) do - circuit_breaker.should_skip_distributed_tracing?(client_config, active_trace) - end - - let(:client_config) { nil } - let(:distributed_tracing) { true } - let(:tracing_apm_enabled) { true } - let(:active_trace) { nil } - let(:non_billing_reject) { true } - - before do - allow(Datadog.configuration.tracing[:http]).to receive(:[]).with(:distributed_tracing).and_return(distributed_tracing) - allow(Datadog.configuration.tracing.apm).to receive(:enabled).and_return(tracing_apm_enabled) - allow(Datadog::Tracing).to receive(:active_trace).and_return(active_trace) - allow(active_trace).to receive(:non_billing_reject?).and_return(non_billing_reject) if active_trace - end - - context 'when distributed tracing is enabled' do - it { is_expected.to be false } - end - - context 'when distributed tracing is disabled' do - let(:distributed_tracing) { false } - - it { is_expected.to be true } - end - - context 'when non billing mode is enabled' do - let(:tracing_apm_enabled) { false } - - context 'when there is no active trace' do - it { is_expected.to be true } - end - - context 'when there is an active trace' do - let(:active_trace) { instance_double(Datadog::Tracing::TraceOperation) } - - context 'when the active trace must be rejected' do - it { is_expected.to be true } - end - - context 'when the active trace must not be rejected' do - # This should act like non-billing mode is disabled, as it does not return in the - # `if Datadog.configuration.tracing.apm.enabled` block - # so we're only testing the "no client config, distributed tracing enabled" case here - let(:non_billing_reject) { false } - - it { is_expected.to be false } - end - end - end - - context 'given a client config with distributed_tracing disabled' do - let(:client_config) { { distributed_tracing: false } } - - it { is_expected.to be true } - end - - context 'given a client config with distributed_tracing enabled' do - let(:client_config) { { distributed_tracing: true } } - - it { is_expected.to be false } - end - end end