lib/opentelemetry/sdk/trace/samplers.rb in opentelemetry-sdk-0.6.0 vs lib/opentelemetry/sdk/trace/samplers.rb in opentelemetry-sdk-0.7.0

- old
+ new

@@ -35,21 +35,21 @@ # to be created. Can be nil. # @param [Hash<String, Object>] attributes Attributes to be attached # to the {Span} to be created. Can be nil. # @return [Result] The sampling result. module Samplers - RECORD_AND_SAMPLED = Result.new(decision: Decision::RECORD_AND_SAMPLED) - NOT_RECORD = Result.new(decision: Decision::NOT_RECORD) - RECORD = Result.new(decision: Decision::RECORD) - SAMPLING_HINTS = [Decision::NOT_RECORD, Decision::RECORD, Decision::RECORD_AND_SAMPLED].freeze + RECORD_AND_SAMPLE = Result.new(decision: Decision::RECORD_AND_SAMPLE) + DROP = Result.new(decision: Decision::DROP) + RECORD_ONLY = Result.new(decision: Decision::RECORD_ONLY) + SAMPLING_HINTS = [Decision::DROP, Decision::RECORD_ONLY, Decision::RECORD_AND_SAMPLE].freeze - private_constant(:RECORD_AND_SAMPLED, :NOT_RECORD, :RECORD, :SAMPLING_HINTS) + private_constant(:RECORD_AND_SAMPLE, :DROP, :RECORD_ONLY, :SAMPLING_HINTS) - # Returns a {Result} with {Decision::RECORD_AND_SAMPLED}. - ALWAYS_ON = ConstantSampler.new(result: RECORD_AND_SAMPLED, description: 'AlwaysOnSampler') + # Returns a {Result} with {Decision::RECORD_AND_SAMPLE}. + ALWAYS_ON = ConstantSampler.new(result: RECORD_AND_SAMPLE, description: 'AlwaysOnSampler') - # Returns a {Result} with {Decision::NOT_RECORD}. - ALWAYS_OFF = ConstantSampler.new(result: NOT_RECORD, description: 'AlwaysOffSampler') + # Returns a {Result} with {Decision::DROP}. + ALWAYS_OFF = ConstantSampler.new(result: DROP, description: 'AlwaysOffSampler') # Returns a new sampler. It delegates to samplers according to the following rules: # # | Parent | parent.remote? | parent.trace_flags.sampled? | Invoke sampler | # |--|--|--|--|