Closed Rdgarg closed 8 months ago
Hi,
Thanks for opening this PR! Is there a specific problem you're solving? Is there perhaps a unit test you could add to go with this change?
Thanks!
Hi ,
Recently I stumbled on one issue in which histogram metrics were not honoring the buckets passed during PrometheusMetrics initialization.
Code snippet
buckets = (0.005, 0.1, 0.2, INF)
metrics = PrometheusMetrics(app, buckets=buckets)
shorten_url_duration = metrics.histogram('shorten_url_duration', 'Duration of shorten_url call')
Sample Response
shorten_url_duration_bucket{le="0.005"} 0.0
shorten_url_duration_bucket{le="0.01"} 0.0
shorten_url_duration_bucket{le="0.025"} 0.0
shorten_url_duration_bucket{le="0.05"} 0.0
shorten_url_duration_bucket{le="0.075"} 0.0
shorten_url_duration_bucket{le="0.1"} 0.0
shorten_url_duration_bucket{le="0.25"} 0.0
shorten_url_duration_bucket{le="0.5"} 0.0
shorten_url_duration_bucket{le="0.75"} 0.0
shorten_url_duration_bucket{le="1.0"} 0.0
shorten_url_duration_bucket{le="2.5"} 0.0
shorten_url_duration_bucket{le="5.0"} 0.0
shorten_url_duration_bucket{le="7.5"} 0.0
shorten_url_duration_bucket{le="10.0"} 0.0
shorten_url_duration_bucket{le="+Inf"} 0.0
Expected Response
shorten_url_duration_bucket{le="0.005"} 0.0
shorten_url_duration_bucket{le="0.1"} 0.0
shorten_url_duration_bucket{le="0.2"} 0.0
shorten_url_duration_bucket{le="+Inf"} 0.0
Will add unit tests, mistakenely this PR got raised to the original repo instead of my fork :( Sorry
…heusClient