Module: Datadog::Analytics::Span

Included in:
Span
Defined in:
lib/ddtrace/analytics.rb

Overview

Extension for Datadog::Span

Instance Method Summary collapse

Instance Method Details

#set_tag(key, value) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ddtrace/analytics.rb', line 15

def set_tag(key, value)
  case key
  when Ext::Analytics::TAG_ENABLED
    # If true, set rate to 1.0, otherwise set 0.0.
    value = value == true ? Ext::Analytics::DEFAULT_SAMPLE_RATE : 0.0
    Analytics.set_sample_rate(self, value)
  when Ext::Analytics::TAG_SAMPLE_RATE
    Analytics.set_sample_rate(self, value)
  else
    super if defined?(super)
  end
end