Skip to main content

Module aggregation

Module aggregation 

Source
Available on crate feature metrics only.
Expand description

Scrape-time aggregation of per-object values into metric families whose cardinality does not depend on the number of objects.

A subsystem that tracks one value per object (per shard, per replica, …) would naively export one series per object. Instead, its collector pushes each object’s current values into an AggregationSnapshot once per scrape and emits what AggregationSnapshot::finish returns. Per AggregatedFamily that is:

  • <name>_percentile: one gauge per entry of PERCENTILES, labeled percentile.
  • <name>_sum: one gauge, the sum of all values, if AggregatedFamily::sum is set.
  • <name>_topk: one gauge for each of the k objects with the largest non-zero value, labeled by AggregationKey. An object that leaves the top k is simply not emitted on the next scrape.

All are exact over the snapshot. Percentiles of different processes cannot be combined into a percentile over all their objects, so these describe one process’s objects.

NOTE: Built at runtime, not with metric!, so bin/gen-metrics-catalog misses them and doc/user/data/metrics.yml has no entry for them.

Structs§

AggregatedFamilies
A fixed set of AggregatedFamilys over objects keyed by K.
AggregatedFamily
The definition of one aggregated per-object value.
AggregationSnapshot
The current values of a set of objects.

Constants§

PERCENTILES
The percentile label values of a _percentile family and the percentile each reports, as a fraction of the objects.

Traits§

AggregationKey
Identifies one object in the _topk families.