From f71f50b4410a9f575441b49b8d73922dbd47ed68 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 21 Oct 2019 13:36:25 -0600 Subject: [PATCH] added prometheseus.histogramQuantile function --- .../prometheus/histogramquantile.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 content/v2.0/reference/flux/stdlib/experimental/prometheus/histogramquantile.md diff --git a/content/v2.0/reference/flux/stdlib/experimental/prometheus/histogramquantile.md b/content/v2.0/reference/flux/stdlib/experimental/prometheus/histogramquantile.md new file mode 100644 index 000000000..74de3e48a --- /dev/null +++ b/content/v2.0/reference/flux/stdlib/experimental/prometheus/histogramquantile.md @@ -0,0 +1,46 @@ +--- +title: prometheus.histogramQuantile() function +description: > + The `prometheus.histogramQuantile()` function calculates quantiles on a set of values + assuming the given histogram data is scraped or read from a Prometheus data source. +menu: + v2_0_ref: + name: prometheus.histogramQuantile + parent: Prometheus +weight: 301 +--- + +The `prometheus.histogramQuantile()` function calculates quantiles on a set of values +assuming the given histogram data is scraped or read from a Prometheus data source. + +_**Function type:** Aggregate_ + +{{% warn %}} +The `prometheus.histogramQuantile()` function is currently experimental and subject to change at any time. +By using this function, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk). +{{% /warn %}} + +```js +import "experimental/prometheus" + +prometheus.histogramQuantile( + quantile: 0.99 +) +``` + +## Parameters + +### quantile +A value between 0.0 and 1.0 indicating the desired quantile. + +_**Data type:** Float_ + +## Examples + +### Calculate the 99th quantile in Prometheus data +```js +import "experimental/prometheus" + +prometheus.scrape(url: "https://example-url.com/metrics") + |> prometheus.histogramQuantile(quantile: 0.99) +```