Calculating quantiles with summaries.

30 views
Skip to first unread message

Mounya A

unread,
Oct 19, 2020, 3:21:39 AM10/19/20
to Prometheus Developers
Hello all, 

        I have a question regarding calculting qunatiles in prometheus.  I can only see every body mentioning the use of histograms to calculate qunatiles .We have quantile function in promql right? . Is it appropriate to use this function with summaries?

Query I am using. 
quantile(.99 ,
             (sum by(job)(rate(api_response_time_sum{job="$stack" , service=~"$product"}[30d])) /
             sum by(job)(rate(api_response_time_count{job="$stack", service=~"$product"}[30d]))
             )
)
will the above query give the desired result? 
 Thanks in Advance . 

Brian Brazil

unread,
Oct 19, 2020, 4:12:43 AM10/19/20
to Mounya A, Prometheus Developers
The quantile there is a noop, as you're only passing in one series. Even fixing that you'd be getting the 99th percentile instance average latency, not the 99th percentile latency of all requests.

If you want to calculate a quantile across an entire job, histograms are the only way to do it correctly.

Brian

 
 Thanks in Advance . 

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/56763331-fa1a-4fd3-b7a1-07d2eaaf53d2n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages