Reference to the cumulativePercentile() function.

Summary

cumulativePercentile(<percentage>, [<bucketName>,] <tsExpression>
   [,metrics|sources|sourceTags|pointTags|<pointTagKey>])

Calculates the cumulative percentile value for a histogram coming from Prometheus cumulative histograms.

Parameters

ParameterDescription
percentage A number between 0 and 100 that specifies the percentile of interest.
bucketName Optional string that describes the bucket. Default is le, that is, less than or equal. If your source histogram uses a different tag key to specify the buckets, specify that tag key here.
tsExpression A Prometheus cumulative histogram.
metrics|sources|sourceTags|pointTags|<pointTagKey> Optional group by parameter for organizing the time series into subgroups and then returning each histogram subgroup. Use one or more parameters to group by metric names, source names, source tag names, point tag names, values for a particular point tag key, or any combination of these items. Specify point tag keys by name.

Description

This function calculates the percentile value from Prometheus cumulative histograms without converting them to Wavefront ordinary histograms.

When a chart displays the result of this function, it shows the cumulative percentile that you define in <percentage>.

Example

This example shows how to use the cumulativePercentile() function to return the cumulative percentile value for the histogram.

cumulativePercentile(95, mavg(1m, rate(ts(demo_api_request_duration_seconds_bucket, path="/api/foo" and status="500" and method="GET" and host="demo.promlabs.com:10000"))))

See Also

Caveats

This function is meant for cumulative histograms, like those that come from Prometheus.