lib/opentelemetry/sdk/trace/samplers.rb in opentelemetry-sdk-0.9.0 vs lib/opentelemetry/sdk/trace/samplers.rb in opentelemetry-sdk-0.10.0
- old
+ new
@@ -36,21 +36,14 @@
# 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_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_SAMPLE, :DROP, :RECORD_ONLY, :SAMPLING_HINTS)
-
# Returns a {Result} with {Decision::RECORD_AND_SAMPLE}.
- ALWAYS_ON = ConstantSampler.new(result: RECORD_AND_SAMPLE, description: 'AlwaysOnSampler')
+ ALWAYS_ON = ConstantSampler.new(decision: Decision::RECORD_AND_SAMPLE, description: 'AlwaysOnSampler')
# Returns a {Result} with {Decision::DROP}.
- ALWAYS_OFF = ConstantSampler.new(result: DROP, description: 'AlwaysOffSampler')
+ ALWAYS_OFF = ConstantSampler.new(decision: Decision::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 |
# |--|--|--|--|