Understanding histogram_quantile based on rate in Prometheus

后端 未结 3 1014
無奈伤痛
無奈伤痛 2021-02-15 14:50

According to Prometheus documentation in order to have a 95th percentile using histogram metric I can use following query:

histogram_quantile(0.95, sum(rate(http         


        
相关标签:
3条回答
  • 2021-02-15 14:52

    You can refer to my reply here

    Actually the rate() function is just used to specify the time window, the denominator has no effect in the computation of the pecentile value.

    0 讨论(0)
  • 2021-02-15 15:00

    You have to use reset because counters can be reset, rate automatically considers resets and give you the right count for each second. Just remember that always use rate before using counters.

    0 讨论(0)
  • 2021-02-15 15:02

    I believe this is the code for it in prometheus
    The general idea is that you use the data in the buckets to extrapolate / approximate the quantiles Elasticsearch also does something similar (yet different/much simpler) in their rollup capabilities

    0 讨论(0)
提交回复
热议问题