Module otel_metric_exemplar_reservoir_simple

Simple Exemplar Reservoir.

Description

Simple Exemplar Reservoir. Exemplars are stored in an ETS table keyed on {StreamName, Attributes, ReaderId, Bucket} where Bucket is calculated as:

    if num_measurements_seen < num_buckets then
      bucket = num_measurements_seen
    else
      bucket = random_integer(0, num_measurements_seen)
    end
    if bucket < num_buckets then
      reservoir[bucket] = measurement
    end

Data Types

config()

config() = #{num_buckets => integer()}

Function Index

collect/3Return all exemplars for a Key and then delete them.
new/1
offer/6

Function Details

collect/3

collect(ExemplarsTab::ets:table(), Key::term(), State::#state{num_buckets = integer()}) -> [otel_metric_exemplar:exemplar()]

Return all exemplars for a Key and then delete them.

new/1

new(X1::config()) -> #state{num_buckets = integer()}

offer/6

offer(Ctx, ExemplarsTab, Key, Value, FilteredAttributes, State) -> any()


Generated by EDoc