module ElasticAPM::SpanHelpers::ClassMethods
@api private
Public Instance Methods
span_class_method(method, name = nil, type = nil)
click to toggle source
# File lib/elastic_apm/span_helpers.rb, line 25 def span_class_method(method, name = nil, type = nil) __span_method_on(singleton_class, method, name, type) end
span_method(method, name = nil, type = nil)
click to toggle source
# File lib/elastic_apm/span_helpers.rb, line 29 def span_method(method, name = nil, type = nil) __span_method_on(self, method, name, type) end
Private Instance Methods
__span_method_on(klass, method, name = nil, type = nil)
click to toggle source
Calls superclass method
# File lib/elastic_apm/span_helpers.rb, line 35 def __span_method_on(klass, method, name = nil, type = nil) name ||= method.to_s type ||= Span::DEFAULT_TYPE klass.prepend(Module.new do define_method(method) do |*args, &block| unless ElasticAPM.current_transaction return super(*args, &block) end ElasticAPM.with_span name.to_s, type.to_s do super(*args, &block) end end end) end