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 ofPERCENTILES, labeledpercentile.<name>_sum: one gauge, the sum of all values, ifAggregatedFamily::sumis set.<name>_topk: one gauge for each of thekobjects with the largest non-zero value, labeled byAggregationKey. An object that leaves the topkis 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§
- Aggregated
Families - A fixed set of
AggregatedFamilys over objects keyed byK. - Aggregated
Family - The definition of one aggregated per-object value.
- Aggregation
Snapshot - The current values of a set of objects.
Constants§
- PERCENTILES
- The
percentilelabel values of a_percentilefamily and the percentile each reports, as a fraction of the objects.
Traits§
- Aggregation
Key - Identifies one object in the
_topkfamilies.