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

[PROF-10275] Enable crashtracking telemetry by default when profiler is enabled #3816

Merged
merged 1 commit into from
Aug 1, 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
7 changes: 0 additions & 7 deletions .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ only-profiling-heap:
DD_PROFILING_ALLOCATION_ENABLED: "true"
DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED: "true"

only-profiling-crashtracking:
extends: .benchmarks
variables:
DD_BENCHMARKS_CONFIGURATION: only-profiling
DD_PROFILING_ENABLED: "true"
DD_PROFILING_EXPERIMENTAL_CRASH_TRACKING_ENABLED: "true"

profiling-and-tracing:
extends: .benchmarks
variables:
Expand Down
7 changes: 5 additions & 2 deletions lib/datadog/core/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,15 @@ def initialize(*_)

# Enables reporting of information when the Ruby VM crashes.
#
# This feature is no longer experimental, and we plan to deprecate this setting and replace it with a
# properly-named one soon.
#
# @default `DD_PROFILING_EXPERIMENTAL_CRASH_TRACKING_ENABLED` environment variable as a boolean,
# otherwise `false`
# otherwise `true`
option :experimental_crash_tracking_enabled do |o|
o.type :bool
o.env 'DD_PROFILING_EXPERIMENTAL_CRASH_TRACKING_ENABLED'
o.default false
o.default true
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/profiling/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def self.build_profiler_component(settings:, agent_settings:, optional_tracer:)
# and thus can't really provide a valid configuration to talk to a Datadog agent. Thus, in this situation,
# we can't use the crashtracker, even if enabled.
unless transport.respond_to?(:exporter_configuration)
Datadog.logger.warn(
Datadog.logger.debug(
'Cannot enable profiling crash tracking as a custom settings.profiling.exporter.transport is configured'
)
return
Expand Down
8 changes: 4 additions & 4 deletions spec/datadog/core/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
context 'is not defined' do
let(:environment) { nil }

it { is_expected.to be false }
it { is_expected.to be true }
end

[true, false].each do |value|
Expand All @@ -843,10 +843,10 @@

describe '#experimental_crash_tracking_enabled=' do
it 'updates the #experimental_crash_tracking_enabled setting' do
expect { settings.profiling.advanced.experimental_crash_tracking_enabled = true }
expect { settings.profiling.advanced.experimental_crash_tracking_enabled = false }
.to change { settings.profiling.advanced.experimental_crash_tracking_enabled }
.from(false)
.to(true)
.from(true)
.to(false)
end
end

Expand Down
8 changes: 3 additions & 5 deletions spec/datadog/profiling/component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,6 @@
end

context 'when crash tracking is enabled' do
before { settings.profiling.advanced.experimental_crash_tracking_enabled = true }

it 'initializes the crash tracker' do
expect(Datadog::Profiling::Crashtracker).to receive(:new).with(
exporter_configuration: array_including(:agent),
Expand All @@ -564,11 +562,11 @@

before do
settings.profiling.exporter.transport = custom_transport
allow(Datadog.logger).to receive(:warn)
allow(Datadog.logger).to receive(:debug)
end

it 'warns that crash tracking will not be enabled' do
expect(Datadog.logger).to receive(:warn).with(/Cannot enable profiling crash tracking/)
it 'debug logs that crash tracking will not be enabled' do
expect(Datadog.logger).to receive(:debug).with(/Cannot enable profiling crash tracking/)

build_profiler_component
end
Expand Down
Loading