From 46f71199819a1f82f1488ef9a36b270d09530c84 Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Tue, 21 Jul 2020 13:05:52 +0200 Subject: [PATCH] more updates related to multi-app servers --- spec/src/main/asciidoc/architecture.adoc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/spec/src/main/asciidoc/architecture.adoc b/spec/src/main/asciidoc/architecture.adoc index 353a9f18..6327b37a 100644 --- a/spec/src/main/asciidoc/architecture.adoc +++ b/spec/src/main/asciidoc/architecture.adoc @@ -326,12 +326,7 @@ There should be a single `MetricRegistry` instance shared between all applicatio of different registries while responding to metric export requests. It is up to the application server whether it will allow sharing of metrics between different applications (for example, if there's a reusable metric in one application, another might want to reuse it). -==== Implementation notes: -Constructors of the `MetricID` class from the API code already handle adding the `_app` tag automatically -when they detect that there is a property named `mp.metrics.appName` available from the `org.eclipse.microprofile.config.Config` instance -available in the current context. If no such property exists or if the value is empty, no tag will be appended. - -Generally, the responsibility of the application server implementation will be to append a property `mp.metrics.appName` to the -`org.eclipse.microprofile.config.Config` instance of each application during deployment time, its value being the web context root of the application -or the JAR name. This can be achieved for example by adding a custom `ConfigSource` with an ordinal less than 100, because -the `ConfigSource` that reads properties `META-INF/microprofile-config.properties` has an ordinal of 100, and this needs to have higher priority. +It should also be noted that because MP Config supports different configuration property values per each application, it can potentially +happen that each application will see a different value of `mp.metrics.tags` which denotes the global tags. In such case, the +implementation must make sure that the value of `mp.metrics.tags` is read only on the global level and thus metrics from all applications +will get the same global tags.