module Atatus::SpanHelpers::ClassMethods
@api private
Public Instance Methods
instrument_class_method(method, name = nil, type = nil, subtype = nil)
click to toggle source
# File lib/atatus/span_helpers.rb, line 33 def instrument_class_method(method, name = nil, type = nil, subtype = nil) __span_method_on(singleton_class, method, name, type, subtype) end
instrument_method(method, name = nil, type = nil, subtype = nil)
click to toggle source
# File lib/atatus/span_helpers.rb, line 37 def instrument_method(method, name = nil, type = nil, subtype = nil) __span_method_on(self, method, name, type, subtype) end
span_class_method(method, name = nil, type = nil, subtype = nil)
click to toggle source
# File lib/atatus/span_helpers.rb, line 25 def span_class_method(method, name = nil, type = nil, subtype = nil) __span_method_on(singleton_class, method, name, type, subtype) end
span_method(method, name = nil, type = nil, subtype = nil)
click to toggle source
# File lib/atatus/span_helpers.rb, line 29 def span_method(method, name = nil, type = nil, subtype = nil) __span_method_on(self, method, name, type, subtype) end
Private Instance Methods
__span_method_on(klass, method, name = nil, type = nil, subtype = nil)
click to toggle source
# File lib/atatus/span_helpers.rb, line 43 def __span_method_on(klass, method, name = nil, type = nil, subtype = nil) name ||= method.to_s type ||= Span::DEFAULT_TYPE subtype ||= Span::DEFAULT_SUBTYPE klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1 alias :"__without_apm_#{method}" :"#{method}" def #{method}(*args, &block) unless Atatus.current_transaction return __without_apm_#{method}(*args, &block) end Atatus.with_span "#{name}", "#{type}", subtype: "#{subtype}" do __without_apm_#{method}(*args, &block) end end RUBY end