module ElasticAPM::SpanHelpers::ClassMethods
def __span_method_on(klass, method, name, type)
def __span_method_on(klass, method, name, type) klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1 alias :"__without_apm_#{method}" :"#{method}" def #{method}(*args, &block) unless ElasticAPM.current_transaction return __without_apm_#{method}(*args, &block) end ElasticAPM.span "#{name}", "#{type}" do __without_apm_#{method}(*args, &block) end end RUBY end
def span_class_method(method, name, type)
def span_class_method(method, name, type) __span_method_on(singleton_class, method, name, type) end