Class: Datadog::Tracing::Contrib::Aws::Service::SNS

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/tracing/contrib/aws/service/sns.rb

Overview

SNS tag handlers.

Instance Method Summary collapse

Instance Method Details

#add_tags(span, params) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/datadog/tracing/contrib/aws/service/sns.rb', line 13

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]
     = parts[-2]
    span.set_tag(Aws::Ext::TAG_AWS_ACCOUNT, )
  end
  span.set_tag(Aws::Ext::TAG_TOPIC_NAME, topic_name)
end