Sha256: b3ae3b4c58c74e5ff2a70897383ee4dbecdd4215a6f7c95b8c317def10e88708

Contents?: true

Size: 693 Bytes

Versions: 12

Compression:

Stored size: 693 Bytes

Contents

# typed: true

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

12 entries across 12 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.8.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.7.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.6.1 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.6.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.5.2 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.5.1 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.5.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.4.2 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.4.1 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.4.0 lib/datadog/tracing/metadata/analytics.rb
ddtrace-1.3.0 lib/datadog/tracing/metadata/analytics.rb