Sha256: e194ce19a23b13bb25ea0c1ac4a6d095c562c75bdec344995a00ef96365229c2

Contents?: true

Size: 816 Bytes

Versions: 31

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true

require_relative './base'
require_relative '../ext'

module Datadog
  module Tracing
    module Contrib
      module Aws
        module Service
          # SNS tag handlers.
          class SNS < Base
            def add_tags(span, params)
              topic_arn = params[:topic_arn]
              topic_name = params[:name]
              if topic_arn
                # example topic_arn: arn:aws:sns:us-west-2:123456789012:my-topic-name
                parts = topic_arn.split(':')
                topic_name = parts[-1]
                aws_account = parts[-2]
                span.set_tag(Aws::Ext::TAG_AWS_ACCOUNT, aws_account)
              end
              span.set_tag(Aws::Ext::TAG_TOPIC_NAME, topic_name)
            end
          end
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
datadog-2.9.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.8.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.7.1 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.7.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.6.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.5.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.4.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.3.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.2.0 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.23.3 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.1.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.0.0 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.0.0.beta2 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/aws/service/sns.rb
datadog-2.0.0.beta1 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/aws/service/sns.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/aws/service/sns.rb