Skip to content

Multiple caches, one metric #244

Open
@twolf-adc

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions