RateLimitingSampler class

A sampler that limits the number of sampled traces per time window.

Implemented types

Constructors

RateLimitingSampler(double maxTracesPerSecond, {Duration timeWindow = const Duration(milliseconds: 100)})
Creates a rate limiting sampler. maxTracesPerSecond specifies how many traces can be sampled per second. timeWindow specifies how often the token balance is updated (defaults to 100ms).

Properties

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

Methods

dispose() → void
Clean up timer resources
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.
override
toString() → String
A string representation of this object.
inherited

Operators

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