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

Multiple caches, one metric #244

Open
twolf-adc opened this issue Apr 8, 2024 · 0 comments
Open

Multiple caches, one metric #244

twolf-adc opened this issue Apr 8, 2024 · 0 comments

Comments

@twolf-adc
Copy link

twolf-adc commented Apr 8, 2024

I currently have multiple caches, that I don't want to join as one. However, in my Prometheus metrics I want all of these caches to use the same metric aka namespace, where each cache has its uniquely identifying label. This way I can easily query Prometheus, showing me the metric over all caches or filtered to (via the label) the one cache I want.

What I tried
Attempting to call cachemetrics.NewPrometheus() multiple times with the same namespace but setting some label differently. This results in a runtime panic (panic: duplicate metrics collector registration attempted).

Other than that, I don't see a way to achieve this. Am I missing something, any suggestion?

Platforms:

alpine Linux

Versions:

v4.1.5

If this is not possible currently, is this a feature that you'd be willing to accept as a contribution from me?

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