Re: [prometheus-users] Re: promql - what is promql for calcuate percetile

2023-03-27 Thread Bjoern Rabenstein
On 20.03.23 03:28, Brian Candler wrote:
> > Note - I have no bucket metrics for histogram. 
> 
> What you say doesn't make sense to me.  What you showed *is* a histogram, 
> and the metrics *prometheus_rule_evaluation_duration_seconds* *are* the 
> buckets.

Strictly speaking, it's a summary, and the metrics labeled with
"quantile" are precalculated
quantiles. Cf. https://prometheus.io/docs/practices/histograms/ 

> Therefore, if those are the metrics you have, then the 50th percentile is 
> simply
> prometheus_rule_evaluation_duration_seconds{quantile="0.5"}
> and the 90th percentile is simply
> prometheus_rule_evaluation_duration_seconds{quantile="0.9"}
> 
> There is no need to "calculate" the p50/p90/p99 latencies because you 
> already have them.

That's correct. Note that there is no way to further aggregate the
pre-calculated quantile (or change them for example to a different
quantile or to a different time interval).

If you need aggregatability or more flexibility for add-hoc queries,
you have to use an actual histogram in your instrumentation of the
monitored target (either the classic histograms or the new
experimental native histograms).

-- 
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in

-- 
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/ZCGTQddnGDnFW5vL%40mail.rabenste.in.


[prometheus-users] Re: promql - what is promql for calcuate percetile

2023-03-20 Thread Brian Candler
> Note - I have no bucket metrics for histogram. 

What you say doesn't make sense to me.  What you showed *is* a histogram, 
and the metrics *prometheus_rule_evaluation_duration_seconds* *are* the 
buckets.

Therefore, if those are the metrics you have, then the 50th percentile is 
simply
prometheus_rule_evaluation_duration_seconds{quantile="0.5"}
and the 90th percentile is simply
prometheus_rule_evaluation_duration_seconds{quantile="0.9"}

There is no need to "calculate" the p50/p90/p99 latencies because you 
already have them.

On Monday, 20 March 2023 at 08:47:46 UTC Prashant Singh wrote:

> Hi , 
>
> Need to be know what is promql for calculate p50th ,p90th , and p99th 
> latency or perctile for bleow metrics
>
> Note - I have no bucket metrics for histogram. 
>
>
> # HELP prometheus_rule_evaluation_duration_seconds The duration for a rule 
> to execute.
> # TYPE prometheus_rule_evaluation_duration_seconds summary
> prometheus_rule_evaluation_duration_seconds{quantile="0.5"} 6.4853e-05
> prometheus_rule_evaluation_duration_seconds{quantile="0.9"} 0.00010102
> prometheus_rule_evaluation_duration_seconds{quantile="0.99"} 0.000177367
> prometheus_rule_evaluation_duration_seconds_sum 1.623860968846092e+06
> prometheus_rule_evaluation_duration_seconds_count 1.112293682e+09
>
> Thanks
> Prashant
> Thanks,
> Prashant
>

-- 
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/32fbb9cb-20d1-4ecd-b539-284df5e9dddbn%40googlegroups.com.