Sampler

org.typelevel.otel4s.sdk.trace.samplers.Sampler
See theSampler companion trait
object Sampler

Attributes

Companion
trait
Source
Sampler.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Sampler.type

Members list

Value members

Concrete methods

Returns a Sampler that always makes the same decision as the parent Span to whether or not to sample.

Returns a Sampler that always makes the same decision as the parent Span to whether or not to sample.

If there is no parent, the sampler uses the provided root Sampler to determine the sampling decision.

Value parameters

root

the Sampler which is used to make the sampling decisions if the parent does not exist

Attributes

Source
Sampler.scala

Creates a ParentBasedSampler.Builder for parent-based sampler that enables configuration of the parent-based sampling strategy.

Creates a ParentBasedSampler.Builder for parent-based sampler that enables configuration of the parent-based sampling strategy.

The parent's sampling decision is used if a parent span exists, otherwise this strategy uses the root sampler's decision.

There are a several options available on the builder to control the precise behavior of how the decision will be made.

Value parameters

root

the Sampler which is used to make the sampling decisions if the parent does not exist

Attributes

Source
Sampler.scala

Creates a new ratio-based sampler.

Creates a new ratio-based sampler.

The ratio of sampling a trace is equal to that of the specified ratio.

The algorithm used by the Sampler is undefined, notably it may or may not use parts of the trace ID when generating a sampling decision.

Currently, only the ratio of traces that are sampled can be relied on, not how the sampled traces are determined. As such, it is recommended to only use this Sampler for root spans using parentBased.

Value parameters

ratio

the desired ratio of sampling. Must be >= 0 and <= 1.0.

Attributes

Source
Sampler.scala