module Datadog::Contrib::Patchable::InstanceMethods

Instance methods for integrations

Public Instance Methods

auto_instrument?() click to toggle source

Can the patch for this integration be applied automatically? For example: test integrations should only be applied by the user explicitly setting `c.use :rspec` and rails sub-modules are auto-instrumented by enabling rails so auto-instrumenting them on their own will cause changes in service naming behavior

# File lib/ddtrace/contrib/patchable.rb, line 65
def auto_instrument?
  true
end
patch() click to toggle source
# File lib/ddtrace/contrib/patchable.rb, line 44
def patch
  if !self.class.patchable? || patcher.nil?
    return {
      name: self.class.name,
      available: self.class.available?,
      loaded: self.class.loaded?,
      compatible: self.class.compatible?,
      patchable: self.class.patchable?
    }
  end

  patcher.patch
  true
end
patcher() click to toggle source
# File lib/ddtrace/contrib/patchable.rb, line 40
def patcher
  nil
end