Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

How is mp.metrics.appName supposed to work? #216

@jmesnil

Description

@jmesnil

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 unique mp.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 call ConfigProvider.getConfig() to load the Config 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 respective META-INF/microprofile-config.properties file.

Am I missing something on how this feature is supposed to work for EAP deployment with subdeployments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions