Sha256: e12bf5a05d8688fe150352a1ab0f5051a901092a17418b38a1cf3dd733f91115

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

require_relative '../analytics'
require_relative 'ext'

module Datadog
  module Tracing
    module Metadata
      # Defines analytics tagging behavior
      module Analytics
        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
            Tracing::Analytics.set_sample_rate(self, value)
          when Ext::Analytics::TAG_SAMPLE_RATE
            Tracing::Analytics.set_sample_rate(self, value)
          else
            super if defined?(super)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ddtrace-1.10.1 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.10.0 lib/datadog/tracing/metadata/analytics.rb