Skip to content

Commit

Permalink
nil values are printed, and profiling logs environment details regard…
Browse files Browse the repository at this point in the history
…less of enabling.
  • Loading branch information
sarahchen6 committed Aug 16, 2023
1 parent 4632878 commit b99ee89
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/datadog/core/diagnostics/environment_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ module EnvironmentLogger
def self.collect_and_log!
log_once! do
data = EnvironmentCollector.collect_config!
data.reject! { |_, v| v.nil? } # Remove empty values from hash output
log_configuration!('CORE', data.to_json)
end
rescue => e
Expand Down
5 changes: 3 additions & 2 deletions lib/datadog/profiling/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ module Component
# * Code Hotspots panel in the trace viewer, as well as scoping a profile down to a span
# * Endpoint aggregation in the profiler UX, including normalization (resource per endpoint call)
def self.build_profiler_component(settings:, agent_settings:, optional_tracer:) # rubocop:disable Metrics/MethodLength
require_relative '../profiling/diagnostics/environment_logger'
Profiling::Diagnostics::EnvironmentLogger.collect_and_log!

return unless settings.profiling.enabled

# Workaround for weird dependency direction: the Core::Configuration::Components class currently has a
Expand Down Expand Up @@ -94,8 +97,6 @@ def self.build_profiler_component(settings:, agent_settings:, optional_tracer:)
transport = build_profiler_transport(settings, agent_settings)
scheduler = Profiling::Scheduler.new(exporter: exporter, transport: transport)

Profiling::Diagnostics::EnvironmentLogger.collect_and_log!

Profiling::Profiler.new([collector], scheduler)
end

Expand Down
1 change: 0 additions & 1 deletion lib/datadog/profiling/diagnostics/environment_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module EnvironmentLogger
def self.collect_and_log!
log_once! do
data = EnvironmentCollector.collect_config!
data.reject! { |_, v| v.nil? } # Remove empty values from hash output
log_configuration!('PROFILING', data.to_json)
end
rescue => e
Expand Down
1 change: 0 additions & 1 deletion lib/datadog/tracing/diagnostics/environment_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module EnvironmentLogger
def self.collect_and_log!(responses: nil)
log_once! do
env_data = EnvironmentCollector.collect_config!
env_data.reject! { |_, v| v.nil? } # Remove empty values from hash output
log_configuration!('TRACING', env_data.to_json)

if responses
Expand Down

0 comments on commit b99ee89

Please sign in to comment.