-
Notifications
You must be signed in to change notification settings - Fork 1k
MultiGauge doesn't work with MeterFilter.map() #6146
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
Conversation
Thank you for finding this bug and proving it with a test.
I'm continue working on it to see if I can find a better solution (how to integrate this with the |
I added caching and an extra test to check the behavior of |
micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java
Show resolved
Hide resolved
micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. I may follow up post merge with some general polish to the MultiGauge code to try to name things in a way that hopefully makes the logic easier to read. It took a bit of re-reading and taking notes to make sure I understood what was happening before and what's happening now.
micrometer-core/src/test/java/io/micrometer/core/instrument/MultiGaugeTest.java
Outdated
Show resolved
Hide resolved
MultiGauge maintains the set of ids of the Gauges it created. These ids are "pre-filtered" which means it stores the ids before the possible transformations done by MeterFilters. This changes the behavior and makes MultiGauge tracking the ids after the MeterFilter transformations. This also means that after this change MeterFilters can run twice.
Thank you @izeye! |
The
MultiGauge
doesn't seem to work with theMeterFilter.ignoreTags()
.See https://github.com/micrometer-metrics/micrometer/pull/6070/files#r2051508975