7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/new_relic/agent/instrumentation/elasticsearch/chain.rb', line 7
def self.instrument!
to_instrument = if NewRelic::Helper.version_satisfied?(::Elasticsearch::VERSION, '<', '8.0.0')
::Elasticsearch::Transport::Client
else
::Elastic::Transport::Client
end
to_instrument.class_eval do
include NewRelic::Agent::Instrumentation::Elasticsearch
alias_method(:perform_request_without_tracing, :perform_request)
alias_method(:perform_request, :perform_request_with_tracing)
def perform_request(*args)
perform_request_with_tracing(*args) do
perform_request_without_tracing(*args)
end
end
end
end
|