Max Value from Histogram

2,708 views
Skip to first unread message

adamdougal

unread,
Aug 14, 2017, 9:47:36 AM8/14/17
to Prometheus Users
Hey, 

I'm currently using a histogram to record application response times. I'd like to keep track of the maximum value but can't see that as an option. Is there anything else I can use or can this be added?

I've used DropWizard metrics in the past which supports this http://metrics.dropwizard.io/3.2.3/getting-started.html#histograms

Cheers

Brian Brazil

unread,
Aug 14, 2017, 10:19:15 AM8/14/17
to adamdougal, Prometheus Users
This isn't supported. The fundamental problem is the maximum over what time period? In Prometheus you are meant to be able to calculate over any time period, and thus there's no way to make this work sanely.

--

barmy...@gmail.com

unread,
Aug 14, 2017, 11:08:50 AM8/14/17
to Prometheus Users, barmy...@gmail.com
Couldn't it essentially work the same way as a Gauge but with an if check first to check if the value is greater?

Brian Brazil

unread,
Aug 14, 2017, 11:23:26 AM8/14/17
to adamdougal, Prometheus Users
On 14 August 2017 at 16:08, <barmy...@gmail.com> wrote:
Couldn't it essentially work the same way as a Gauge but with an if check first to check if the value is greater?

That doesn't tell you when the max was, it could be from now or from a month ago. Logs would be a better way to track this. 

Brian
 

On Monday, 14 August 2017 15:19:15 UTC+1, Brian Brazil wrote:
On 14 August 2017 at 14:47, adamdougal <barmy...@gmail.com> wrote:
Hey, 

I'm currently using a histogram to record application response times. I'd like to keep track of the maximum value but can't see that as an option. Is there anything else I can use or can this be added?

I've used DropWizard metrics in the past which supports this http://metrics.dropwizard.io/3.2.3/getting-started.html#histograms

This isn't supported. The fundamental problem is the maximum over what time period? In Prometheus you are meant to be able to calculate over any time period, and thus there's no way to make this work sanely.

--

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/01bda33c-568e-4381-81c4-72352d13e30a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

barmy...@gmail.com

unread,
Aug 15, 2017, 5:38:49 AM8/15/17
to Prometheus Users, barmy...@gmail.com
Sorry I'm not sure I follow. With my current gauges I can see when they were increased/decreased so I don't understand why I wouldn't be able to here?

Cheers

Adam


On Monday, 14 August 2017 16:23:26 UTC+1, Brian Brazil wrote:
On 14 August 2017 at 16:08, <barmy...@gmail.com> wrote:
Couldn't it essentially work the same way as a Gauge but with an if check first to check if the value is greater?

That doesn't tell you when the max was, it could be from now or from a month ago. Logs would be a better way to track this. 

Brian
 

On Monday, 14 August 2017 15:19:15 UTC+1, Brian Brazil wrote:
On 14 August 2017 at 14:47, adamdougal <barmy...@gmail.com> wrote:
Hey, 

I'm currently using a histogram to record application response times. I'd like to keep track of the maximum value but can't see that as an option. Is there anything else I can use or can this be added?

I've used DropWizard metrics in the past which supports this http://metrics.dropwizard.io/3.2.3/getting-started.html#histograms

This isn't supported. The fundamental problem is the maximum over what time period? In Prometheus you are meant to be able to calculate over any time period, and thus there's no way to make this work sanely.

--

--
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-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--

Brian Brazil

unread,
Aug 15, 2017, 5:43:39 AM8/15/17
to adamdougal, Prometheus Users
On 15 August 2017 at 10:38, <barmy...@gmail.com> wrote:
Sorry I'm not sure I follow. With my current gauges I can see when they were increased/decreased so I don't understand why I wouldn't be able to here?

You can see snapshots of the gauge, you can't see exactly when they increased/decreased. So for example if the max is 10, and then over the next 5 minutes the max is 4 - we have no way to tell that the max over the last 5 minutes that the max is 4 as all we ever see is that initial 10.

Brian
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f3e426e5-e34d-4917-8122-7959ffc276f6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

emai...@gmail.com

unread,
Aug 15, 2017, 11:48:13 AM8/15/17
to Prometheus Users, barmy...@gmail.com
What about adding maximum as a property of a Summary i.e. <basename>_maximum?

Or can we set a bucket of 1.0 and get the same thing?


On Monday, 14 August 2017 15:19:15 UTC+1, Brian Brazil wrote:

Brian Brazil

unread,
Aug 15, 2017, 12:17:01 PM8/15/17
to emai...@gmail.com, Prometheus Users, adamdougal
On 15 August 2017 at 16:48, <emai...@gmail.com> wrote:
What about adding maximum as a property of a Summary i.e. <basename>_maximum?

That has the same fundamental problems.

Or can we set a bucket of 1.0 and get the same thing?

I'm not sure how accurate that will be.

Brian 

On Monday, 14 August 2017 15:19:15 UTC+1, Brian Brazil wrote:
On 14 August 2017 at 14:47, adamdougal <barmy...@gmail.com> wrote:
Hey, 

I'm currently using a histogram to record application response times. I'd like to keep track of the maximum value but can't see that as an option. Is there anything else I can use or can this be added?

I've used DropWizard metrics in the past which supports this http://metrics.dropwizard.io/3.2.3/getting-started.html#histograms

This isn't supported. The fundamental problem is the maximum over what time period? In Prometheus you are meant to be able to calculate over any time period, and thus there's no way to make this work sanely.

--

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Björn Rabenstein

unread,
Aug 16, 2017, 11:24:56 AM8/16/17
to Brian Brazil, emai...@gmail.com, Prometheus Users, adamdougal
In a Summary, you can set a objective for 1.0 or 0.0 (for the max or
min, respectively), but as Brian mentioned, the semantics might not be
what you expect. In the case of the Summary, you'll get the max or min
over MaxAge, as defined in the SummaryOpts, i.e. it's something set by
the monitored target and cannot be changed in the PromQL expression.

Surely, you can use 1.0 or 0.0 in the histogram_quantile call, but the
accuracy is determined by your bucket layout.


--
Björn Rabenstein, Engineer
http://soundcloud.com/brabenstein

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany
Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B
Reply all
Reply to author
Forward
0 new messages