Including answer from Gen-AI:

| Description                         | PromQL Query                       
                                                                            
  | Notes                                                                   
                        |
|-------------------------------------|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| Minimum request duration (1m)       | histogram_quantile(0, sum by (le) 
(rate(http_request_duration_seconds_bucket[1m])))                           
  | Fast but may be noisy or return NaN if low traffic. Good for 
near-real-time.                   |
| Maximum request duration (1m)       | histogram_quantile(1, sum by (le) 
(rate(http_request_duration_seconds_bucket[1m])))                           
  | Same as above, for longest duration estimate.                           
                        |
| Minimum request duration (5m)       | histogram_quantile(0, sum by (le) 
(rate(http_request_duration_seconds_bucket[5m])))                           
  | More stable, smoother estimate over a slightly longer window.           
                        |
| Maximum request duration (5m)       | histogram_quantile(1, sum by (le) 
(rate(http_request_duration_seconds_bucket[5m])))                           
  | Recommended when traffic is bursty or histogram series are sparse.     
                        |

Please confirm if the above answer is reliable or not. 
On Wednesday, June 18, 2025 at 3:23:54 PM UTC+2 tejaswini vadlamudi wrote:

> Hi,
>
> I’m using Prometheus to monitor request durations via a histogram metric, 
> e.g., http_request_duration_seconds_bucket. I would like to query:
>
>    - The minimum time taken by a request
>    - The maximum time taken by a request
>
> …over a given time range (say, the last 1h or 24h).
>
> I understand that histogram buckets give cumulative counts of requests 
> below certain durations, but I’m not sure how to extract the actual min or 
> max values of request durations during a time window.
>
> Is this possible directly via PromQL? Or is there a recommended workaround 
> (e.g., recording rules, external processing, or using histogram_quantile() in 
> a specific way)?
>
> Thanks in advance for any guidance!
>
> Br,
> Teja
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/prometheus-users/c5b389db-bff7-4434-b1c8-d034fc90f9dan%40googlegroups.com.

Reply via email to