Module: Datadog::Tracing::Contrib::Lograge::Instrumentation::InstanceMethods

Defined in:
lib/datadog/tracing/contrib/lograge/instrumentation.rb

Overview

Instance methods for configuration

Instance Method Summary collapse

Instance Method Details

#custom_options(event) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/datadog/tracing/contrib/lograge/instrumentation.rb', line 15

def custom_options(event)
  return super unless Datadog.configuration.tracing.log_injection
  return super unless Datadog.configuration.tracing[:lograge].enabled

  original_custom_options = super(event)

  # Retrieves trace information for current thread
  correlation = Tracing.correlation
  # merge original lambda with datadog context
  correlation.to_h.merge(original_custom_options)
end