Class: Datadog::Tracing::Configuration::Dynamic::TracingSamplingRate

Inherits:
SimpleOption
  • Object
show all
Defined in:
lib/datadog/tracing/configuration/dynamic.rb

Overview

Dynamic configuration for ‘DD_TRACE_SAMPLE_RATE`.

Instance Attribute Summary

Attributes inherited from Option

#env_var, #name

Instance Method Summary collapse

Constructor Details

#initializeTracingSamplingRate

Returns a new instance of TracingSamplingRate.



39
40
41
# File 'lib/datadog/tracing/configuration/dynamic.rb', line 39

def initialize
  super('tracing_sampling_rate', 'DD_TRACE_SAMPLE_RATE', :default_rate)
end

Instance Method Details

#call(tracing_sampling_rate) ⇒ Object

Ensures sampler is rebuilt and new configuration is applied



44
45
46
47
# File 'lib/datadog/tracing/configuration/dynamic.rb', line 44

def call(tracing_sampling_rate)
  super
  Datadog.send(:components).reconfigure_live_sampler
end