15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/datadog/tracing/diagnostics/environment_logger.rb', line 15
def self.collect_and_log!(responses: nil)
if log?
log_configuration!('TRACING', EnvironmentCollector.collect_config!.to_json)
log_debug!('TRACING INTEGRATIONS', EnvironmentCollector.collect_integrations_settings!.to_json)
if responses
err_data = EnvironmentCollector.collect_errors!(responses)
err_data.reject! { |_, v| v.nil? } log_error!('TRACING', 'Agent Error', err_data.to_json) unless err_data.empty?
end
end
rescue => e
logger.warn("Failed to collect tracing environment information: #{e} Location: #{Array(e.backtrace).first}")
end
|