25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/new_relic/agent/instrumentation/aws_sdk_firehose/instrumentation.rb', line 25
def instrument_method_with_new_relic(method_name, *args)
return yield unless NewRelic::Agent::Tracer.tracing_enabled?
NewRelic::Agent.record_instrumentation_invocation(FIREHOSE)
params = args[0]
segment = NewRelic::Agent::Tracer.start_segment(name: get_segment_name(method_name, params))
arn = get_arn(params) if params
segment&.add_agent_attribute('cloud.resource_id', arn) if arn
begin
NewRelic::Agent::Tracer.capture_segment_error(segment) { yield }
ensure
segment&.add_agent_attribute('cloud.platform', AWS_KINESIS_DELIVERY_STREAMS)
segment&.finish
end
end
|