Sha256: dadaf7c3af8f27da6ce4913c3378d51ef4df9749f77f504b0f73b7cabfbe0b0e

Contents?: true

Size: 713 Bytes

Versions: 4

Compression:

Stored size: 713 Bytes

Contents

# typed: true

require 'datadog/tracing/analytics'
require 'datadog/tracing/metadata/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

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.1.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.0.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.0.0.beta2 lib/datadog/tracing/metadata/analytics.rb