Uses the throughput information from all operations to update their sampling probability and optionally boost operations if there is any throughput leftover.
Decides whether a trace should be sampled or not.
Decides whether a trace should be sampled or not. The provided SpanBuilder contains the information that has been gathered so far for what will become the root Span for the new Trace.
Makes the sampler update its internal state and reassign probabilities to all known operations.
Makes the sampler update its internal state and reassign probabilities to all known operations. Rebalancing only happens when new operations appear and does not take the actual operation throughput into account to assign the base throughput to each operation.
An adaptive sampler tries to balance a global throughput goal across all operations in the current application, making the best possible effort to provide sampled traces from all operations and to satisfy all configured rules.
This sampler divides the task of balancing the load into two phases: rebalancing and adapting. Rebalancing happens every time a new operation is seen by the sampler and splits the overall throughput allocation across all operations seen so far, only taking the configured throughput goal and rules into account. Adapting happens every second and tries to adjust the sampling rate for each individual operation based on the historical behavior of the operation, the target throughput set during rebalance and take advantage of any "unused" throughput by distributing across more active operations.