class Instana::Instrumentation::SNS::Handler

Public Instance Methods

call(context) click to toggle source
# 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.trace(:sns, {sns: sns_tags}) { @handler.call(context) }
  else
    @handler.call(context)
  end
end