Skip to content
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

[NO-TICKET] Remove deprecated profiler settings #3597

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/UpgradeGuide2.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Datadog.configure do |c|
end
```

<h4 id="2.0-type-checking">Enforce type checking</h4>
<h4 id="2.0-type-checking">Enforced type checking</h4>

Configuration options are type checked. When validation fails, an `ArgumentError` is raised.

Expand Down Expand Up @@ -124,7 +124,7 @@ B3 propagation has been removed from the default propagation for distributed tra

- Option `c.tracing.client_ip.enabled`: `ENV['DD_TRACE_CLIENT_IP_HEADER_DISABLED']` is removed. Use `ENV['DD_TRACE_CLIENT_IP_ENABLED']` instead.

- The following programmatic configuration options have been changed. Their corresponding environment variables (if any) are unchanged:
- The following configuration options have been changed. Changes to their corresponding environment variables (if any) are noted as well:

| 1.x | 2.0 |
| -------------------------------------------------------- | ------------------------------------- |
Expand All @@ -134,13 +134,15 @@ B3 propagation has been removed from the default propagation for distributed tra
| `tracing.distributed_tracing.propagation_style` | `tracing.propagation_style` |
| `diagnostics.health_metrics.enabled` | `health_metrics.enabled` |
| `diagnostics.health_metrics.statsd` | `health_metrics.statsd` |
| `profiling.advanced.max_events` | Removed |
| `profiling.advanced.legacy_transport_enabled` | Removed |
| `profiling.advanced.force_enable_new_profiler` | Removed |
| `profiling.advanced.force_enable_legacy_profiler` | Removed |
| `profiling.advanced.allocation_counting_enabled` | Removed |
| `profiling.advanced.experimental_allocation_enabled` | `profiling.allocation_enabled` (`DD_PROFILING_ALLOCATION_ENABLED` environment variable) |
| `profiling.advanced.experimental_allocation_sample_rate` | Removed |
| `profiling.advanced.experimental_timeline_enabled` | `profiling.advanced.timeline_enabled` |
| `profiling.advanced.experimental_timeline_enabled` | `profiling.advanced.timeline_enabled` (`DD_PROFILING_TIMELINE_ENABLED` environment variable, enabled by default) |
| `profiling.advanced.force_enable_gc_profiling` | `profiling.advanced.gc_enabled` (`DD_PROFILING_GC_ENABLED` environment variable, enabled by default) |
| `profiling.advanced.force_enable_legacy_profiler` | Removed |
| `profiling.advanced.force_enable_new_profiler` | Removed |
| `profiling.advanced.legacy_transport_enabled` | Removed |
| `profiling.advanced.max_events` | Removed |

<h2 id="2.0-advanced-usage">Advanced Usage</h2>

Expand Down
79 changes: 0 additions & 79 deletions lib/datadog/core/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,6 @@ def initialize(*_)
o.default true
end

# Forces enabling of profiling of time/resources spent in Garbage Collection.
#
# Note that setting this to "false" (or not setting it) will not prevent the feature from being
# being automatically enabled in the future.
#
# GC profiling is now on by default and controlled by {:gc_enabled}.
option :force_enable_gc_profiling do |o|
o.after_set do |_, _, precedence|
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
Datadog.logger.warn(
'The profiling.advanced.force_enable_gc_profiling setting has been deprecated for removal and no ' \
'longer does anything (the feature is now on by default). ' \
'Please remove this setting from your Datadog.configure block.'
)
end
end
end

# Can be used to enable/disable garbage collection profiling.
#
# @warn To avoid https://bugs.ruby-lang.org/issues/18464 even when enabled, GC profiling is only started
Expand All @@ -310,36 +292,6 @@ def initialize(*_)
o.default true
end

# Can be used to enable/disable the Datadog::Profiling.allocation_count feature.
#
# @deprecated Use {:allocation_enabled} (outside of advanced section) instead.
option :allocation_counting_enabled do |o|
o.after_set do |_, _, precedence|
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
Datadog.logger.warn(
'The profiling.advanced.allocation_counting_enabled setting has been deprecated for removal and no ' \
'longer does anything. Please remove it from your Datadog.configure block. ' \
'Allocation counting is now controlled by the profiling.allocation_enabled setting instead.'
)
end
end
end

# @deprecated Use {:allocation_enabled} (outside of advanced section) instead.
option :experimental_allocation_enabled do |o|
o.type :bool
o.default false
o.after_set do |_, _, precedence|
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
Datadog.logger.warn(
'The profiling.advanced.experimental_allocation_enabled setting has been deprecated for removal and ' \
'no longer does anything. Please remove it from your Datadog.configure block. ' \
'Allocation profiling is now controlled by the profiling.allocation_enabled setting instead.'
)
end
end
end

# Can be used to enable/disable the collection of heap profiles.
#
# This feature is alpha and disabled by default
Expand Down Expand Up @@ -367,22 +319,6 @@ def initialize(*_)
o.default true # This gets ANDed with experimental_heap_enabled in the profiler component.
end

# Can be used to configure the allocation sampling rate: a sample will be collected every x allocations.
#
# This feature is now controlled via {:overhead_target_percentage}
option :experimental_allocation_sample_rate do |o|
o.after_set do |_, _, precedence|
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
Datadog.logger.warn(
'The profiling.advanced.experimental_allocation_sample_rate setting has been deprecated for removal ' \
'and no longer does anything. Please remove it from your Datadog.configure block. ' \
'Allocation sample rate is now handled by a dynamic sampler which will adjust the sampling rate to ' \
'keep to the configured `profiling.advanced.overhead_target_percentage`.'
)
end
end
end

# Can be used to configure the heap sampling rate: a heap sample will be collected for every x allocation
# samples.
#
Expand Down Expand Up @@ -410,21 +346,6 @@ def initialize(*_)
o.default false
end

# Enables data collection for the timeline feature. This is still experimental and not recommended yet.
#
# @default `DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED` environment variable as a boolean, otherwise `false`
option :experimental_timeline_enabled do |o|
o.after_set do |_, _, precedence|
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
Datadog.logger.warn(
'The profiling.advanced.experimental_timeline_enabled setting has been deprecated for removal ' \
'and no longer does anything. Please remove it from your Datadog.configure block. ' \
'The timeline feature counting is now controlled by the `timeline_enabled` setting instead.'
)
end
end
end

# Controls data collection for the timeline feature.
#
# If you needed to disable this, please tell us why on <https://github.com/DataDog/dd-trace-rb/issues/new>,
Expand Down
40 changes: 0 additions & 40 deletions spec/datadog/core/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,6 @@
end
end

describe '#force_enable_gc_profiling=' do
it 'logs a warning informing customers this no longer does anything' do
expect(Datadog.logger).to receive(:warn).with(/no longer does anything/)

settings.profiling.advanced.force_enable_gc_profiling = true
end
end

describe '#gc_enabled' do
subject(:gc_enabled) { settings.profiling.advanced.gc_enabled }

Expand Down Expand Up @@ -500,22 +492,6 @@
end
end

describe '#allocation_counting_enabled=' do
it 'logs a warning informing customers this no longer does anything' do
expect(Datadog.logger).to receive(:warn).with(/no longer does anything/)

settings.profiling.advanced.allocation_counting_enabled = false
end
end

describe '#experimental_allocation_enabled=' do
it 'logs a warning informing customers this no longer does anything' do
expect(Datadog.logger).to receive(:warn).with(/no longer does anything/)

settings.profiling.advanced.experimental_allocation_enabled = true
end
end

describe '#experimental_heap_enabled' do
subject(:experimental_heap_enabled) { settings.profiling.advanced.experimental_heap_enabled }

Expand Down Expand Up @@ -586,14 +562,6 @@
end
end

describe '#experimental_allocation_sample_rate=' do
it 'logs a warning informing customers this no longer does anything' do
expect(Datadog.logger).to receive(:warn).with(/no longer does anything/)

settings.profiling.advanced.experimental_allocation_sample_rate = 0
end
end

describe '#experimental_heap_sample_rate' do
subject(:experimental_heap_sample_rate) { settings.profiling.advanced.experimental_heap_sample_rate }

Expand Down Expand Up @@ -697,14 +665,6 @@
end
end

describe '#experimental_timeline_enabled=' do
it 'logs a warning that this no longer does anything' do
expect(Datadog.logger).to receive(:warn).with(/no longer does anything/)

settings.profiling.advanced.experimental_timeline_enabled = 0
end
end

describe '#timeline_enabled' do
subject(:timeline_enabled) { settings.profiling.advanced.timeline_enabled }

Expand Down
Loading