12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb', line 12
def perform_request_with_tracing(method, path, params = {}, body = nil, = nil)
return yield unless NewRelic::Agent::Tracer.tracing_enabled?
segment = NewRelic::Agent::Tracer.start_datastore_segment(
product: PRODUCT_NAME,
operation: nr_operation || OPERATION,
host: nr_hosts[:host],
port_path_or_id: path,
database_name: nr_cluster_name
)
begin
NewRelic::Agent::Tracer.capture_segment_error(segment) { yield }
ensure
if segment
segment.notice_nosql_statement(nr_reported_query(body || params))
segment.finish
end
end
end
|