Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To calculate p99 over a specific time period using PromQL, you can use the following syntax:

histogram_quantile(0.99, sum(rate(metric_name_bucket[time_range])) by (le)) 

Where metric_name is the name of the metric you want to calculate p99 for, time_range is the time period over which to calculate p99, and le is the label that represents bucket boundaries in the histogram.

For example, to calculate the p99 of the http_request_duration_seconds metric over the last 5 minutes, you can use the following query:

histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))

This will return the p99 value for the http_request_duration_seconds metric over the last 5 minutes.