Skip to content

Commit

Permalink
more updates related to multi-app servers
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartisk committed Jul 21, 2020
1 parent f9ee251 commit 46f7119
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions spec/src/main/asciidoc/architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 46f7119

Please sign in to comment.