Sha256: a8f15ace6836f58a7a6011a41dffa23f077fb27e93014f4e4a543ce0b5aa779f
Contents?: true
Size: 835 Bytes
Versions: 7
Compression:
Stored size: 835 Bytes
Contents
# frozen_string_literal: true module ElasticAPM # @api private module Spies # @api private class ElasticsearchSpy NAME_FORMAT = '%s %s'.freeze TYPE = 'db.elasticsearch'.freeze 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) context = Span::Context.new(statement: args[0]) ElasticAPM.span name, TYPE, context: context do perform_request_without_apm(method, path, *args, &block) end end end end end register( 'Elasticsearch::Transport::Client', 'elasticsearch-transport', ElasticsearchSpy.new ) end end
Version data entries
7 entries across 7 versions & 1 rubygems