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

Histogram are breaking prometheus #1

Closed
L3o-pold opened this issue Jul 8, 2020 · 1 comment
Closed

Histogram are breaking prometheus #1

L3o-pold opened this issue Jul 8, 2020 · 1 comment

Comments

@L3o-pold
Copy link

L3o-pold commented Jul 8, 2020

const histogram = Histogram.with({
    name: 'http_requests_duration',
    help: 'A histogram of the requests duration.',
    buckets: [ .05, .1, .2, .5, 1, 3 ],
});

histogram.observe(.42);
histogram.observe(.58);
Registry.default.metrics()

Will render

# HELP http_requests_duration A histogram of the requests duration.
# TYPE http_requests_duration histogram
http_requests_duration_bucket,le="0.05"} 0
http_requests_duration_bucket,le="0.1"} 0
http_requests_duration_bucket,le="0.2"} 0
http_requests_duration_bucket,le="0.5"} 0
http_requests_duration_bucket,le="1"} 4
http_requests_duration_bucket,le="3"} 4
http_requests_duration_bucket,le="+Inf"} 5
http_requests_duration_sum 8
http_requests_duration_count 5

It breaks prometheus as a { is missing in keys.

I think the issue is located here https://github.com/marcopacini/ts-prometheus/blob/master/histogram.ts#L56 or in the example.

@marcopacini
Copy link
Owner

@L3o-pold Thank you for reporting me this issue.

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

2 participants