prometheus-haskell icon indicating copy to clipboard operation
prometheus-haskell copied to clipboard

Enbable configurable buckets for `http_request_duration_seconds`

Open VictorCMiraldo opened this issue 2 years ago • 0 comments

The requestLatency function picks the default set of buckets, which very rigid... We have two situations: either our servers are talking between each other in the same datacenter, which means requests are blazing fast and we see things like:

http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.005"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.01"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.025"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.05"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.1"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.25"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="0.5"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="1.0"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="2.5"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="5.0"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="10.0"} 1860
http_request_duration_seconds_bucket{handler="prometheus",method="GET",status_code="200",le="+Inf"} 1860
http_request_duration_seconds_sum{handler="prometheus",method="GET",status_code="200"} 7.270726499999998e-2
http_request_duration_seconds_count{handler="prometheus",method="GET",status_code="200"} 1860

Which is useless... The other situation we face is dual: we're handling long running requests, and all our requests end up in the +Inf bucket. I'd love to be able to configure the buckets for requestLatency to get useful information from this data.

VictorCMiraldo avatar Feb 23 '23 10:02 VictorCMiraldo