Skip to content

Commit

Permalink
Refactored: Move DD_TRACE_ENABLED to Tracing namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
delner committed Dec 1, 2022
1 parent 1fc093b commit f4dbaac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/core/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def initialize(*_)
# @default `DD_TRACE_ENABLED` environment variable, otherwise `true`
# @return [Boolean]
option :enabled do |o|
o.default { env_to_bool(Datadog::Core::Diagnostics::Ext::DD_TRACE_ENABLED, true) }
o.default { env_to_bool(Tracing::Configuration::Ext::ENV_ENABLED, true) }
o.lazy
end

Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/core/diagnostics/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Diagnostics
module Ext
DD_TRACE_STARTUP_LOGS = 'DD_TRACE_STARTUP_LOGS'.freeze
DD_TRACE_DEBUG = 'DD_TRACE_DEBUG'.freeze
DD_TRACE_ENABLED = 'DD_TRACE_ENABLED'.freeze

# Health
module Health
# Metrics
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog/tracing/configuration/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Datadog
module Tracing
module Configuration
module Ext
ENV_ENABLED = 'DD_TRACE_ENABLED'.freeze

# @public_api
module Analytics
ENV_TRACE_ANALYTICS_ENABLED = 'DD_TRACE_ANALYTICS_ENABLED'.freeze
Expand Down
4 changes: 2 additions & 2 deletions spec/datadog/core/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,9 @@

it { is_expected.to be true }

context "when #{Datadog::Core::Diagnostics::Ext::DD_TRACE_ENABLED}" do
context "when #{Datadog::Tracing::Configuration::Ext::ENV_ENABLED}" do
around do |example|
ClimateControl.modify(Datadog::Core::Diagnostics::Ext::DD_TRACE_ENABLED => enable) do
ClimateControl.modify(Datadog::Tracing::Configuration::Ext::ENV_ENABLED => enable) do
example.run
end
end
Expand Down

0 comments on commit f4dbaac

Please sign in to comment.