Sampler class abstract

Interface for sampling decision logic.

Samplers are responsible for deciding whether a span should be sampled (i.e., recorded and exported) or not. This decision is typically made when a span is started, based on various factors such as the parent context, trace ID, and span attributes.

More information: https://opentelemetry.io/docs/specs/otel/trace/sdk/#sampler

Constructors

Sampler()

Properties

description → String
Gets a description of this sampler.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldSample({required Context parentContext, required String traceId, required String name, required SpanKind spanKind, required Attributes? attributes, required List<SpanLink>? links}) → SamplingResult
Makes a sampling decision based on the provided parameters.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited