Class: OpenTelemetry::SDK::Trace::Samplers::ConstantSampler Private
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Trace::Samplers::ConstantSampler
- Defined in:
- lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Implements a sampler returning a constant result.
Instance Attribute Summary collapse
- #description ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(result:, description:) ⇒ ConstantSampler
constructor
private
A new instance of ConstantSampler.
- #should_sample?(trace_id:, parent_context:, links:, name:, kind:, attributes:) ⇒ Boolean private
Constructor Details
#initialize(result:, description:) ⇒ ConstantSampler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ConstantSampler.
17 18 19 20 |
# File 'lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb', line 17 def initialize(result:, description:) @result = result @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb', line 15 def description @description end |
Instance Method Details
#should_sample?(trace_id:, parent_context:, links:, name:, kind:, attributes:) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 |
# File 'lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb', line 25 def should_sample?(trace_id:, parent_context:, links:, name:, kind:, attributes:) # All arguments ignored for sampling decision. @result end |