Module otel_metric_exemplar_reservoir_aligned_histogram

Exemplar Reservoir used by the Explicit Histogram Aggregation.

Description

Exemplar Reservoir used by the Explicit Histogram Aggregation. The same bucket boundaries as the aggregation. Simple algorithm for adding each new measurement as an exemplar:

    bucket = find_histogram_bucket(measurement)
    if bucket < num_buckets then
      reservoir[bucket] = measurement
    end
 
    def find_histogram_bucket(measurement):
      for boundary, idx in bucket_boundaries do
        if value <= boundary then
          return idx
        end
      end
      return boundaries.length

Data Types

config()

config() = #{explicit_bucket_boundaries => [float()]}

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{bucket_boundaries = [float()]}) -> [otel_metric_exemplar:exemplar()]

Return all exemplars for a Key and then delete them.

new/1

new(X1::config()) -> #state{bucket_boundaries = [float()]}

offer/6

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


Generated by EDoc