Class: Instana::Instrumentation::SNS::Handler

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/instana/instrumentation/aws_sdk_sns.rb

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/instana/instrumentation/aws_sdk_sns.rb', line 8

def call(context)
  sns_tags = {
    topic: context.params[:topic_arn],
    target: context.params[:target_arn],
    phone: context.params[:phone_number],
    subject: context.params[:subject]
  }.reject { |_, v| v.nil? }

  if context.operation_name == :publish
    ::Instana.tracer.in_span(:sns, attributes: {sns: sns_tags}) { @handler.call(context) }
  else
    @handler.call(context)
  end
end