13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/new_relic/agent/instrumentation/opensearch/instrumentation.rb', line 13
def perform_request_with_tracing(_method, _path, params = NewRelic::EMPTY_HASH, body = nil, = nil, _opts = nil, &_block)
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: nr_hosts[:port],
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
|