You could use a subquery to get the max_over_time() of the
histogram_quantile(). Warning, computing this could be very expensive, so
best to have the quantile saved in a recording rule.

On Thu, Dec 3, 2020 at 9:24 AM b.ca...@pobox.com <b.cand...@pobox.com>
wrote:

> You can't get the maximum or minimum out of a histogram.  A histogram only
> counts the number of occurrences within each bucket; it doesn't store the
> individual values.
>
> You can get an *estimate* of (say) the 1st percentile and 99th percentile
> values using the histogram_quantile
> <https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile>
> function.
>
> On Thursday, 3 December 2020 at 06:01:37 UTC rbtestprom...@gmail.com
> wrote:
>
>> Hi,
>>
>> We are logging the duration of some long running operations to prometheus
>> as a histogram metric.
>>
>> We would like to compute the Longest/shortest running duration of the
>> long running job with specfic date range from the histogram metric.   How
>> can we achieve this using PromQL
>>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/prometheus-users/8be18b7a-fd27-411c-9815-37dc6dd8651an%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/8be18b7a-fd27-411c-9815-37dc6dd8651an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CABbyFmoJqfsvyR3%2BqFx7EXX2sxhvRet4jL3gn4jF6fGpUtgWRw%40mail.gmail.com.

Reply via email to