Skip to content

Commit

Permalink
address github comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahchen6 committed Aug 11, 2023
1 parent b61584c commit 263a0eb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/datadog/core/diagnostics/environment_logger.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'date'
require 'json'
require 'rbconfig'
Expand Down Expand Up @@ -60,7 +62,7 @@ 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'.freeze, data.to_json)
log_configuration!('CORE', data.to_json)
end
rescue => e
logger.warn("Failed to collect core environment information: #{e} Location: #{Array(e.backtrace).first}")
Expand Down Expand Up @@ -96,7 +98,7 @@ def date
# Best portable guess of OS information.
# @return [String] platform string
def os_name
RbConfig::CONFIG['host'.freeze]
RbConfig::CONFIG['host']
end

# @return [String] ddtrace version
Expand Down Expand Up @@ -172,7 +174,7 @@ def health_metrics_enabled

# Outputs "k1:v1,k2:v2,..."
def hash_serializer(h)
h.map { |k, v| "#{k}:#{v}" }.join(','.freeze)
h.map { |k, v| "#{k}:#{v}" }.join(',')
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/datadog/core/diagnostics/environment_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'
require 'datadog/core/diagnostics/environment_logger'
require 'ddtrace/transport/io'
Expand Down
2 changes: 2 additions & 0 deletions spec/datadog/profiling/diagnostics/environment_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'
require 'datadog/profiling/diagnostics/environment_logger'
require 'ddtrace/transport/io'
Expand Down
2 changes: 2 additions & 0 deletions spec/datadog/tracing/diagnostics/environment_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'
require 'datadog/tracing/diagnostics/environment_logger'
require 'ddtrace/transport/io'
Expand Down

0 comments on commit 263a0eb

Please sign in to comment.