-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support for meters with same names but different tag keys in prometheus registry #2653
base: main
Are you sure you want to change the base?
Conversation
…keys dynamically like it already does it for tag values
It would be great to see this merged. Is there any reason it hasn't been? Not sure who to tag on this but how about it @jonatan-ivanov? |
Any updates? The solution seems simple and would provide great value. |
Please see this issue for more details: prometheus/client_java#696 |
Please take a look at prometheus/client_java#901 |
Same problem here: Each instance exposes the same set of metrics If I could set a label for each metric using the instance name and such metric objects are treated individually then it would work for this setup. Otherwise I don't see any good solution apart from adding instance name into the metric name which is super ugly |
I have an idea how to resolve this issue #877
and raising this PR to discuss it.
The PR has a basic implementation + some simple tests to verify it works and makes sense in general.
I wanted to make sure that the solution makes sense first before going the full path and spending hours or days on making it bullet-proof and efficient. So any input is welcome.
So what this fix does:
MicrometerCollector
is changed to store tag keys dynamically like it does for tag values now, it can return tag keys and values in samples without any issue and prometheus will be able to parse it correctly.What I did:
MicrometerCollector
to store the holders instead of tag values.MicrometerCollector
to get tag keys from the holders.