-
Notifications
You must be signed in to change notification settings - Fork 36
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
How is mp.metrics.appName
supposed to work?
#216
Comments
Sorry I was on paternity leave, hence the late response. |
From my quick experiments, it looks like each module has its own |
Most importantly, congrats for the baby! :) I debugged the loading and execution of the The class is loaded with the EAR module class loader. That means that hen metrics are registered in |
Thanks! :) Well yep, so the Changing this (if it's really a bug) would fix our problem I suppose, because we would then pick up the correct |
The _app feature was removed with MP-Metrics Spec 3.0! |
SR Metrics itself does not support application-name tags right now, it would be up to the app server (WildFly etc) to provide it, but we haven't figured out how exactly that should be done (SR would probably have to provide some facility to allow it, now that it was moved out of the MP API). Given the status of SmallRye Metrics being deprecated and replaced with Micrometer, I don't see that very likely. |
MP Metrics provides a recommendation to support multiple applications
However it also mention that this recommendation also applies to EAR with subdeployments.
It write that the subdeployments can use their
META-INF/microprofile-config.properties
properties file to specify an uniquemp.metrics.appName
property.This does not work with smallrye-metrics. All injected metrics (regardless of the subdeployments) are registered from io.smallrye.metrics.setup.MetricCdiInjectionExtension.
The code will end up in
org.eclipse.microprofile.metrics.MetricID#MetricID(java.lang.String, org.eclipse.microprofile.metrics.Tag...)
that will callConfigProvider.getConfig()
to load theConfig
object to read the configuration properties.At this point, the
Config
will be fetched corresponding to the TCCL which is the EAR ClassLoader.All registered metrics in the EAR will use the same
Config
object and will not use their properties from their respectiveMETA-INF/microprofile-config.properties
file.Am I missing something on how this feature is supposed to work for EAP deployment with subdeployments?
The text was updated successfully, but these errors were encountered: