10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/instana/instrumentation/aws_sdk_sqs.rb', line 10
def call(context)
is_tracing = ::Instana.tracer.tracing?
unless is_tracing && SPAN_FORMING_OPERATIONS.include?(context.operation_name)
return @handler.call(context)
end
span_tags = tags_for(context.operation_name, context.params).reject { |_, v| v.nil? }
::Instana.tracer.in_span(:sqs, attributes: {sqs: span_tags}) do |span|
case context.operation_name
when :send_message
(span, context.params)
when :send_message_batch
context.params[:entries].each { |e| (span, e) }
end
response = @handler.call(context)
span_tags[:queue] = response.queue_url if response.respond_to?(:queue_url)
span.add_attributes(sqs: span_tags)
response
end
end
|