-
Notifications
You must be signed in to change notification settings - Fork 992
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
CompositeMeterRegistry filters are ignored if they are the child of another CompositeMeterRegistry #3020
Comments
Is this still a problem using the latest Micrometer versions? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open. |
I can reproduce the reported behavior with the provided test. |
without this change non composite descendant do not know about the configuration of their parents with this change we're merging that configuration fixes gh-3020
I don't think adding meter filters of the child registry to the composite registry is a good thing. If there are multiple child registries added to a composite meter registry and each has a filter to allow only certain data for the registry, then adding all the meter filters to the composite will prevent from adding any meters. E.g: Assume global has two registry implementations A and B. There is one-meter filter in each which does this,
If both of these are added to global, no meter will be registered since both cases cannot be true. |
I understand but why would you want to add both to global? If someone adds a meter filter on the composite then it seems to make sense to pass these filters to child registries? |
Lof of open-source libraries (like reactor netty, resilience4j, etc.) add the metrics to global registries and users just wire up a registry implementation to export these metrics. So, you would need to add the registries to get these metrics. One more good use-case is to segregate the user code from registry-specific things. In case, ceratin data needs to be sent to a different back-end, we would just add a registry with the required filters.
This can be true but haven't given a lot of thought to this. |
Describe the bug
CompositeMeterRegistry
A containsCompositeMeterRegistry
B contains someMeterRegistry
CEnvironment
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
To Reproduce
How to reproduce the bug:
Expected behavior
I would expect that the filters of the child CompositeMeterRegistry would be applied
The text was updated successfully, but these errors were encountered: