Percentiles_bucket

Percentiles bucket aggregation

/ Percentiles_bucket, / Aggregation

Percentiles bucket aggregation #

A sibling pipeline aggregation computing percentiles of a metric across buckets — e.g. “the daily-revenue p95”. The mean of the per-bucket values answers “what is typical”; percentiles answer “what the whole ladder of buckets looks like” — including the outlier end that a stats_bucket min/max flattens into two numbers.

"day_pcts": { "percentiles_bucket": { "buckets_path": "per_day>revenue" } }

How it works #

percentiles_bucket is declared next to the bucket aggregation it consumes and runs after every regular aggregation — including the distributed merge — has finished. It walks the parent’s finished buckets, collects one number per bucket, sorts them, and evaluates each requested percentile over the sorted sample, returning a {"values": {...}} object keyed by the percentile:

...