Module: Datadog::Contrib::Analytics
- Defined in:
- lib/ddtrace/contrib/analytics.rb
Overview
Defines analytics behavior for integrations
Class Method Summary collapse
-
.enabled?(flag = nil) ⇒ Boolean
Checks whether analytics should be enabled.
- .set_sample_rate(span, sample_rate) ⇒ Object
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.
11 12 13 |
# File 'lib/ddtrace/contrib/analytics.rb', line 11 def enabled?(flag = nil) (Datadog.configuration.analytics_enabled && flag != false) || flag == true end |
.set_sample_rate(span, sample_rate) ⇒ Object
15 16 17 |
# File 'lib/ddtrace/contrib/analytics.rb', line 15 def set_sample_rate(span, sample_rate) Datadog::Analytics.set_sample_rate(span, sample_rate) end |