content/flux/v0/stdlib/experimental/prometheus/histogramquantile.md
prometheus.histogramQuantile() calculates a quantile on a set of Prometheus histogram values.
This function supports Prometheus metric parsing formats
used by prometheus.scrape(), the Telegraf promtheus input plugin, and
InfluxDB scrapers available in InfluxDB OSS.
(<-tables: stream[{B with le: D, _field: C}], quantile: float, ?metricVersion: A, ?onNonmonotonic: string) => stream[E] where A: Equatable, C: Equatable, E: Record
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}}) Quantile to compute. Must be a float value between 0.0 and 1.0.
Prometheus metric parsing format
used to parse queried Prometheus data.
Available versions are 1 and 2.
Default is 2.
Input data. Default is piped-forward data (<-).
Describes behavior when counts are not monotonically increasing
when sorted by upper bound. Default is error.
Supported values:
import "experimental/prometheus"
prometheus.scrape(url: "http://localhost:8086/metrics")
|> filter(fn: (r) => r._measurement == "prometheus")
|> filter(fn: (r) => r._field == "qc_all_duration_seconds")
|> prometheus.histogramQuantile(quantile: 0.99)
import "experimental/prometheus"
from(bucket: "example-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "qc_all_duration_seconds")
|> prometheus.histogramQuantile(quantile: 0.99, metricVersion: 1)