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

Avoid using promauto for metrics registration #394

Open
tpaschalis opened this issue Oct 9, 2023 · 2 comments
Open

Avoid using promauto for metrics registration #394

tpaschalis opened this issue Oct 9, 2023 · 2 comments

Comments

@tpaschalis
Copy link
Member

Recently, #342 migrated packages from weaveworks/common to dskit.

One of the changes was to replaced the use of prometheus with promauto which in cases of downstream users who try to instantiate multiple instances of objects (eg. due to configuration reloads) triggers "duplicate metrics collector registration attempted" panics, for example here and here.

We should allow downstream consumers of packages to pass in their own Prometheus registerers for these metrics, or default to the global one if nil is passed.

@pstibrany
Copy link
Member

Avoid using promauto for metrics registration

Let's use promauto.With(reg)... with supplied registrerer.

@bboreham
Copy link
Contributor

bboreham commented Oct 9, 2023

More detail required on why you think promauto is involved.
Most of the errors you point to don't even include dskit in the stack.

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

3 participants