class ElasticAPM::Spies::ElasticsearchSpy
@api private
def install
def install ::Elasticsearch::Transport::Client.class_eval do alias perform_request_without_apm perform_request def perform_request(method, path, *args, &block) name = format(NAME_FORMAT, method, path) statement = args[0].is_a?(String) ? args[0] : args[0].to_json context = Span::Context.new(db: { statement: statement }) ElasticAPM.with_span name, TYPE, context: context do perform_request_without_apm(method, path, *args, &block) end end end end
def perform_request(method, path, *args, &block)
def perform_request(method, path, *args, &block) name = format(NAME_FORMAT, method, path) statement = args[0].is_a?(String) ? args[0] : args[0].to_json context = Span::Context.new(db: { statement: statement }) ElasticAPM.with_span name, TYPE, context: context do perform_request_without_apm(method, path, *args, &block) end end