module Datadog::Contrib::Analytics

Defines analytics behavior for integrations

Public Instance Methods

enabled?(flag = nil) click to toggle source

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

# File lib/ddtrace/contrib/analytics.rb, line 12
def enabled?(flag = nil)
  (Datadog.configuration.analytics.enabled && flag != false) || flag == true
end
set_measured(span, value = true) click to toggle source
# File lib/ddtrace/contrib/analytics.rb, line 20
def set_measured(span, value = true)
  Datadog::Analytics.set_measured(span, value)
end
set_sample_rate(span, sample_rate) click to toggle source
# File lib/ddtrace/contrib/analytics.rb, line 16
def set_sample_rate(span, sample_rate)
  Datadog::Analytics.set_sample_rate(span, sample_rate)
end