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



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

def datadog_pin
  Datadog.configuration_for(pin_candidate)
end

#datadog_pin=(pin) ⇒ Object



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

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

#pin_candidate(candidate = self) ⇒ Object



152
153
154
155
156
157
158
# File 'lib/datadog/tracing/contrib/elasticsearch/patcher.rb', line 152

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