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

Added support for non-default Prometheus CollectorRegistry #876

Merged
merged 2 commits into from
Apr 26, 2017

Conversation

llucherini
Copy link
Contributor

Hey.
This PR introduces a new constructor in PrometheusMetricsTracker and a constructor overload in PrometheusMetricsTrackerFactory to enable configuration of whatever Promethes CollectorRegistry one might want to use. It's completely backwards compatible and shouldn't affect any existing codebase relying on this.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 77.228% when pulling 02a2d4a on llucherini:dev into 3b8d964 on brettwooldridge:dev.

@brettwooldridge brettwooldridge merged commit b626396 into brettwooldridge:dev Apr 26, 2017
@cemo
Copy link

cemo commented May 11, 2017

Hi @llucherini,

What was your use case to adding custom registration support? Since this current buggy form does not support multiple datasource and causing errors we need to fix this. However custom registration makes the code pretty much ugly to fix.

@cemo
Copy link

cemo commented May 11, 2017

Please see #851

@cemo
Copy link

cemo commented May 11, 2017

BTW It is worth to mention CollectorRegistry from Prometheus javadoc:

The majority of users should use the {@link #defaultRegistry}, rather than instantiating their own.
Creating a registry other than the default is primarily useful for unittests, or pushing a subset of metrics to the Pushgateway from batch jobs.

So I offer to revert this change which is causing ugly implementations to fix current buggy implementation.

@llucherini
Copy link
Contributor Author

Hey. The use case is exactly the one stated in Prometheus javadocs, unit testing.
For us this is a nice to have, but it's not extremely important or vital, so feel free to revert it.

@cemo
Copy link

cemo commented May 11, 2017

thanks @llucherini.

We will revert this change in favor or supporting multiple datasource at once.

kollstrom pushed a commit to kollstrom/HikariCP that referenced this pull request Feb 4, 2021
…dridge#876)

* Added support for using a Prometheus CollectorRegistry other than the default one

* Fixed a broken test
kollstrom pushed a commit to kollstrom/HikariCP that referenced this pull request Feb 4, 2021
…dridge#876)

* Added support for using a Prometheus CollectorRegistry other than the default one

* Fixed a broken test
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

Successfully merging this pull request may close these issues.

4 participants