Sha256: 1130072d898a96fb27b407e7e83a6a6438f64a563dd4ea7aba3818b57f0d7e20
Contents?: true
Size: 820 Bytes
Versions: 13
Compression:
Stored size: 820 Bytes
Contents
require 'ddtrace/ext/analytics' module Datadog # Defines analytics behavior module Analytics class << self def set_sample_rate(span, sample_rate) return if span.nil? || !sample_rate.is_a?(Numeric) span.set_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE, sample_rate) end end # Extension for Datadog::Span module Span 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 end end end
Version data entries
13 entries across 13 versions & 2 rubygems