You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SimpleExemplarReservoir This Exemplar reservoir MAY take a configuration parameter for the size of the reservoir pool. The reservoir will accept measurements using an equivalent of the naive reservoir sampling algorithm
bucket = random_integer(0, num_measurements_seen)
if bucket < num_buckets then
reservoir[bucket] = measurement
end
Reading the article, it seems like the implementation given here is incorrect or at least incomplete. For the first n elements where n is the size of the reservoir the exemplar should be offered to bucket n-1. Only after the reservoir is full should exemplars be sampled by generating the random number.
A more complete example might be:
bucket = num_measurements_seen if num_measurements_seen < reservoir.size else random_integer(0, num_measurements_seen)
if bucket < num_buckets then
reservoir[bucket] = measurement
end
The text was updated successfully, but these errors were encountered:
This is a good call out, by simplification was, partially, on purpose, assuming high-load on measurements. However, the version you list is better for low-volume instruments. We should update the example.
In practice, the important aspect of this sampler is that the likelihood of sampling changes as more measurement are seen.
Fixes#2205Fixes#3674Fixes#3669
Partially fixes#2421
## Changes
- Update example exemplar algorithm to account for initial reservoir
fill
- Update fixed-size defaults to account for memory contention /
optimization in Java impl
- Set a default for exponential histogram aggregation
- Clarify that ExemplarFilter should be configured on MeterProvider
- Make it clear that ONE reservoir is create PER timeseries datapoint
(not one reservoir per view or metric name).
- Allow flexibility in Reservoir `offer` definition based on feedback
from Go impl.
* Related issues #3756
---------
Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
In exemplar defaults the SimpleExemplarReservoir is defined as:
Reading the article, it seems like the implementation given here is incorrect or at least incomplete. For the first
n
elements wheren
is the size of the reservoir the exemplar should be offered to bucketn-1
. Only after the reservoir is full should exemplars be sampled by generating the random number.A more complete example might be:
The text was updated successfully, but these errors were encountered: