Sha256: 88babda018f90435235c25178bf195d3d175db183925dac0f1d6d47c43a41f91

Contents?: true

Size: 669 Bytes

Versions: 4

Compression:

Stored size: 669 Bytes

Contents

# typed: true

require 'datadog/tracing/metadata/ext'

module Datadog
  module Tracing
    # Defines analytics behavior
    module Analytics
      class << self
        def set_sample_rate(span_op, sample_rate)
          return if span_op.nil? || !sample_rate.is_a?(Numeric)

          span_op.set_metric(Metadata::Ext::Analytics::TAG_SAMPLE_RATE, sample_rate)
        end

        def set_measured(span_op, value = true)
          return if span_op.nil?

          value = value == true || value == 1 ? 1 : 0 # rubocop:disable Style/MultipleComparison
          span_op.set_metric(Metadata::Ext::Analytics::TAG_MEASURED, value)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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