Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honoring buckets passed while initializing PrometheusMetrics in Histogram #174

Open
Rdgarg opened this issue Mar 27, 2024 · 0 comments
Open

Comments

@Rdgarg
Copy link

Rdgarg commented Mar 27, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant