Sha256: 5eee1c22a077bbb158304d903f499c7cfbd0d078b57ef628653573cdd0d871a8

Contents?: true

Size: 813 Bytes

Versions: 44

Compression:

Stored size: 813 Bytes

Contents

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021

module Instana
  module Instrumentation
    class SNS < Seahorse::Client::Plugin
      class Handler < Seahorse::Client::Handler
        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
      end

      def add_handlers(handlers, _config)
        handlers.add(Handler, step: :initialize)
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
instana-1.217.1 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.217.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.216.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.215.1 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.215.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.214.4 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.214.3 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.214.2 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.214.1 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.214.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.213.3 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.213.2 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.213.1 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.213.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.212.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.211.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.210.1 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.210.0 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.209.8 lib/instana/instrumentation/aws_sdk_sns.rb
instana-1.209.7 lib/instana/instrumentation/aws_sdk_sns.rb