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
Gauges with unknown tags during compile time #630
Comments
You can register separate gauges, eg I have an application where I maintain my own map of registered gauges (but there might be a better way to this). This is in scala but it should easy enough to do in Java too.
|
Also using a map, but this is a memory leak waiting to happen. As a map can contain hard and unused references for deleted teams. As it is, micrometer has no other way than to introduce a memory leak for handling tags in Gauges. |
@Necropaw you could use soft/weak references in the map (something like a WeakHashMap) |
Trying to roll all the "multi-gauge" issues into one. Closing in favor of #807. |
Hi,
I am currently migrating an application from Spring Boot 1.5.x to 2.x and I am stuck on Micrometer with gauges and tags.
The application uses gauges to measure running processes for a team. The value can increase and decrease over time and also the teams are loaded from a database and can change (add & delete), e.g.:
Can you point me in the direction on how to achieve this with Micrometer?
Afaik it is possible to register a gauge with tag key/values, if they are known beforehand, but this is not the case here.
It is possible to search for a gauge, but the value can not be changed - only read.
The only solution I currently see is to implement my own registry for gauges, search in this registry by name and tags for an AtomicLong and change the value. This can not be right solution.
The text was updated successfully, but these errors were encountered: