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

It would be nice to support multiple Prometheus registries #44

Open
davidhopkins opened this issue Mar 9, 2021 · 1 comment
Open

It would be nice to support multiple Prometheus registries #44

davidhopkins opened this issue Mar 9, 2021 · 1 comment

Comments

@davidhopkins
Copy link

At the moment because the default registry is used this is not possible. For example if you have an application with two Gin servers the second gin-prometheus handler will fail with an error like:

time="2021-03-09T17:43:51Z" level=error msg="requests_total could not be registered in Prometheus" error="duplicate metrics collector registration attempted"
time="2021-03-09T17:43:51Z" level=error msg="request_duration_seconds could not be registered in Prometheus" error="duplicate metrics collector registration attempted"
time="2021-03-09T17:43:51Z" level=error msg="response_size_bytes could not be registered in Prometheus" error="duplicate metrics collector registration attempted"
time="2021-03-09T17:43:51Z" level=error msg="request_size_bytes could not be registered in Prometheus" error="duplicate metrics collector registration attempted"

Cheers!

@codysk
Copy link

codysk commented Nov 3, 2021

#50
I have same issue and made a pr for it.
Maybe it can help you :)

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