Module: Datadog::Tracing::Contrib::Elasticsearch::Patcher::DatadogPin

Defined in:
lib/datadog/tracing/contrib/elasticsearch/patcher.rb

Overview

Patch to support both ‘elasticsearch` and `elastic-transport` versions

Instance Method Summary collapse

Instance Method Details

#datadog_pinObject



143
144
145
# File 'lib/datadog/tracing/contrib/elasticsearch/patcher.rb', line 143

def datadog_pin
  Datadog.configuration_for(pin_candidate)
end

#datadog_pin=(pin) ⇒ Object



139
140
141
# File 'lib/datadog/tracing/contrib/elasticsearch/patcher.rb', line 139

def datadog_pin=(pin)
  pin.onto(pin_candidate)
end

#pin_candidate(candidate = self) ⇒ Object



147
148
149
150
151
152
153
# File 'lib/datadog/tracing/contrib/elasticsearch/patcher.rb', line 147

def pin_candidate(candidate = self)
  if candidate.respond_to?(:transport)
    pin_candidate(candidate.transport)
  else
    candidate
  end
end