Skip to content

Commit

Permalink
Change from _app and _scope to mp_app and mp_scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Channyboy committed Aug 17, 2022
1 parent 86294b9 commit 838c825
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions spec/src/main/asciidoc/architecture.adoc
Expand Up @@ -128,7 +128,7 @@ For portability reasons, the key name for the tag must match the regex `[a-zA-Z_
If an illegal character is used, the implementation must throw an `IllegalArgumentException`.
If a duplicate tag is used, the last occurrence of the tag is used.

The tags named `_scope` and `_app` are reserved. If an application attempts to create a metric with either of these tags, the implementation must throw an `IllegalArgumentException`.
The tags named `mp_scope` and `mp_app` are reserved. If an application attempts to create a metric with either of these tags, the implementation must throw an `IllegalArgumentException`.

The tag value may contain any UTF-8 encoded character.

Expand All @@ -154,7 +154,7 @@ Global tags and tags registered with the metric are included in the output retur

Global tags MUST NOT be added to the `MetricID` objects. Global tags must be included in list of tags when metrics are exported.

NOTE: In application servers with multiple applications deployed, there is one reserved tag name: `_app`, which serves for
NOTE: In application servers with multiple applications deployed, there is one reserved tag name: `mp_app`, which serves for
distinguishing metrics from different applications and must not be used for any other purpose. For details,
see section <<app-servers>>.

Expand Down Expand Up @@ -288,13 +288,13 @@ how such application servers should behave if they want to support MicroProfile
Metrics from all applications and scopes should be available under a single REST endpoint ending with `/metrics` similarly as
in case of single-application deployments (microservices).

To help distinguish between metrics pertaining to each deployed application, a tag named `_app` should be added to each metric.
To help distinguish between metrics pertaining to each deployed application, a tag named `mp_app` should be added to each metric.

The value of the `_app` tag should be passed by the application server to the application via a MicroProfile Config property named `mp.metrics.appName`.
The value of the `mp_app` tag should be passed by the application server to the application via a MicroProfile Config property named `mp.metrics.appName`.
It should be possible to override this value by bundling the file `META-INF/microprofile-config.properties` within the application archive
and setting a custom value for the property `mp.metrics.appName` inside it.

It is allowed for application servers to choose to not add the _app tag at all. Implementations may differ in how they handle cases where
It is allowed for application servers to choose to not add the mp_app tag at all. Implementations may differ in how they handle cases where
metrics are registered with the same name from two or more applications running in the same server. This behavior is not expected to be
portable across vendors.

40 changes: 20 additions & 20 deletions spec/src/main/asciidoc/rest-endpoints.adoc
Expand Up @@ -43,7 +43,7 @@ Quantile values, as used in Histogram and Timer output, should represent recent
----
# HELP current_temperature_celsius The current temperature. <1>
# TYPE current_temperature_celsius gauge <2>
current_temperature_celsius{_scope="application",server="front_office"} 36.2 <3>
current_temperature_celsius{mp_scope="application",server="front_office"} 36.2 <3>
----

<1> The description of the gauge, from the `getDescription()` method of the `Metadata` associated to the gauge, must be provided in the HELP line
Expand All @@ -60,7 +60,7 @@ current_temperature_celsius{_scope="application",server="front_office"} 36.2 <3>
----
# HELP messages_processed_events_total Number of messages handled <1>
# TYPE messages_processed_events_total counter <2>
messages_processed_events_total{_scope="application"} 1.0 <3>
messages_processed_events_total{mp_scope="application"} 1.0 <3>
----

<1> The description of the counter must be provided in the HELP line
Expand All @@ -77,17 +77,17 @@ messages_processed_events_total{_scope="application"} 1.0 <3>
----
# HELP distance_to_hole_meters_max Distance of golf ball to hole <1>
# TYPE distance_to_hole_meters_max gauge <2>
distance_to_hole_meters_max{_scope="golf_stats"} 12.722726616315509 <3>
distance_to_hole_meters_max{mp_scope="golf_stats"} 12.722726616315509 <3>
# HELP distance_to_hole_meters Distance of golf ball to hole <1>
# TYPE distance_to_hole_meters summary <2>
distance_to_hole_meters{_scope="golf_stats",quantile="0.5"} 2.8748779296875 <3>
distance_to_hole_meters{_scope="golf_stats",quantile="0.75"} 4.4998779296875 <3>
distance_to_hole_meters{_scope="golf_stats",quantile="0.95"} 7.9998779296875 <3>
distance_to_hole_meters{_scope="golf_stats",quantile="0.98"} 9.4998779296875 <3>
distance_to_hole_meters{_scope="golf_stats",quantile="0.99"} 11.9998779296875 <3>
distance_to_hole_meters{_scope="golf_stats",quantile="0.999"} 12.9998779296875 <3>
distance_to_hole_meters_count{_scope="golf_stats"} 487.0 <3>
distance_to_hole_meters_sum{_scope="golf_stats"} 1569.3785694223322 <3>
distance_to_hole_meters{mp_scope="golf_stats",quantile="0.5"} 2.8748779296875 <3>
distance_to_hole_meters{mp_scope="golf_stats",quantile="0.75"} 4.4998779296875 <3>
distance_to_hole_meters{mp_scope="golf_stats",quantile="0.95"} 7.9998779296875 <3>
distance_to_hole_meters{mp_scope="golf_stats",quantile="0.98"} 9.4998779296875 <3>
distance_to_hole_meters{mp_scope="golf_stats",quantile="0.99"} 11.9998779296875 <3>
distance_to_hole_meters{mp_scope="golf_stats",quantile="0.999"} 12.9998779296875 <3>
distance_to_hole_meters_count{mp_scope="golf_stats"} 487.0 <3>
distance_to_hole_meters_sum{mp_scope="golf_stats"} 1569.3785694223322 <3>
----

`Histogram` output is comprised of a maximum section and a summary section.
Expand Down Expand Up @@ -124,17 +124,17 @@ distance_to_hole_meters_sum{_scope="golf_stats"} 1569.3785694223322 <3>
----
# HELP myClass_myMethod_seconds duration of myMethod <1>
# TYPE myClass_myMethod_seconds summary <2>
myClass_myMethod_seconds{_scope="vendor",quantile="0.5"} 0.0524288 <3>
myClass_myMethod_seconds{_scope="vendor",quantile="0.75"} 0.0524288 <3>
myClass_myMethod_seconds{_scope="vendor",quantile="0.95"} 0.054525952 <3>
myClass_myMethod_seconds{_scope="vendor",quantile="0.98"} 0.054525952 <3>
myClass_myMethod_seconds{_scope="vendor",quantile="0.99"} 0.054525952 <3>
myClass_myMethod_seconds{_scope="vendor",quantile="0.999"} 0.054525952 <3>
myClass_myMethod_seconds_count{_scope="vendor"} 100.0 <3>
myClass_myMethod_seconds_sum{_scope="vendor"} 5.310349419 <3>
myClass_myMethod_seconds{mp_scope="vendor",quantile="0.5"} 0.0524288 <3>
myClass_myMethod_seconds{mp_scope="vendor",quantile="0.75"} 0.0524288 <3>
myClass_myMethod_seconds{mp_scope="vendor",quantile="0.95"} 0.054525952 <3>
myClass_myMethod_seconds{mp_scope="vendor",quantile="0.98"} 0.054525952 <3>
myClass_myMethod_seconds{mp_scope="vendor",quantile="0.99"} 0.054525952 <3>
myClass_myMethod_seconds{mp_scope="vendor",quantile="0.999"} 0.054525952 <3>
myClass_myMethod_seconds_count{mp_scope="vendor"} 100.0 <3>
myClass_myMethod_seconds_sum{mp_scope="vendor"} 5.310349419 <3>
# HELP myClass_myMethod_seconds_max duration of myMethod <1>
# TYPE myClass_myMethod_seconds_max gauge <2>
myClass_myMethod_seconds_max{_scope="vendor"} 0.05507899 <3>
myClass_myMethod_seconds_max{mp_scope="vendor"} 0.05507899 <3>
----

`Timer` output is comprised of a maximum section and a summary section.
Expand Down

0 comments on commit 838c825

Please sign in to comment.