lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb in opentelemetry-sdk-0.9.0 vs lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb in opentelemetry-sdk-0.10.0
- old
+ new
@@ -8,24 +8,23 @@
module SDK
module Trace
module Samplers
# @api private
#
- # Implements a sampler returning a constant result.
+ # Implements a sampler returning a result with a constant decision.
class ConstantSampler
attr_reader :description
- def initialize(result:, description:)
- @result = result
+ def initialize(decision:, description:)
+ @decision = decision
@description = description
end
# @api private
#
# See {Samplers}.
def should_sample?(trace_id:, parent_context:, links:, name:, kind:, attributes:)
- # All arguments ignored for sampling decision.
- @result
+ Result.new(decision: @decision, tracestate: OpenTelemetry::Trace.current_span(parent_context).context.tracestate)
end
end
end
end
end