Module: Datadog::Tracing::Contrib::Analytics

Defined in:
lib/datadog/tracing/contrib/analytics.rb

Overview

Defines analytics behavior for integrations

Class Method Summary collapse

Class Method Details

.enabled?(flag = nil) ⇒ Boolean

Checks whether analytics should be enabled. ‘flag` is a truthy/falsey value that represents a setting on the integration.

Returns:

  • (Boolean)


14
15
16
# File 'lib/datadog/tracing/contrib/analytics.rb', line 14

def enabled?(flag = nil)
  (Datadog.configuration.tracing.analytics.enabled && flag != false) || flag == true
end

.set_measured(span, value = true) ⇒ Object



22
23
24
# File 'lib/datadog/tracing/contrib/analytics.rb', line 22

def set_measured(span, value = true)
  Tracing::Analytics.set_measured(span, value)
end

.set_sample_rate(span, sample_rate) ⇒ Object



18
19
20
# File 'lib/datadog/tracing/contrib/analytics.rb', line 18

def set_sample_rate(span, sample_rate)
  Tracing::Analytics.set_sample_rate(span, sample_rate)
end