Skip to content

Commit

Permalink
7062-Added-mp-50-51-diff-to-doc
Browse files Browse the repository at this point in the history
7062-Added-mp-50-51-diff-to-doc

#7062
  • Loading branch information
ramkumar-k-9286 committed Dec 1, 2023
1 parent 34d0128 commit df99f05
Showing 1 changed file with 72 additions and 1 deletion.
73 changes: 72 additions & 1 deletion modules/reference/pages/diff/mp-60-61-diff.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,79 @@ If you are updating your application from using MicroProfile 6.0 features to usi

The MicroProfile Metrics 5.1 release introduces many changes to the specification and programming model that impact users who are migrating from MicroProfile Metrics 5.0.

The MicroProfile Metrics 5.1 release introduces a swathe of new MicroProfile Config properties that are used to customize the metric data that is tracked and output by the histogram and timer metrics. MicroProfile Metrics 5.1 introduces new properties that make it possible for you to specify a custom range of percentiles and a custom set of histogram buckets specifically for Histogram and Timer metrics. More configuration properties are now available for establishing a default range of histogram buckets, including options to specify the starting and ending points of the bucket set.

.New Properties in MicroProfile Metrics 5.1
|===

| Name| Description

|`mp.metrics.distribution.percentiles`
|Customize the percentile or quantile output for histogram and timers

|`mp.metrics.distribution.histogram.buckets`
| Customize the set of histogram-buckets to be output by histogram metric

|`mp.metrics.distribution.timer.buckets`
| Customize the set of histogram-buckets to be output by timer metric

|`mp.metrics.distribution.percentiles-histogram.enabled`
| Enable a pre-set list of histogram-buckets for the histogram or timer metric

|`mp.metrics.distribution.histogram.min-value`
| Upper bound bucket for pre-set list of histogram-buckets for histogram metric

|`mp.metrics.distribution.histogram.max-value`
| Lower bound bucket for pre-set list of histogram-buckets for histogram metric

|`mp.metrics.distribution.timer.min-value`
| Upper bound bucket for pre-set list of timer-buckets for histogram metric

|`mp.metrics.distribution.timer.max-value`
| Lower bound bucket for pre-set list of timer-buckets for histogram metric

|===

For more information on the properties and how to use them, see the xref:microprofile-config-properties.adoc#metrics[MicroProfile Config properties: MicroProfile Metrics].

The following example of MicroProfile Config definitions sets up the `alpha.timer` metric to output the 50th, 70th, 75th, and 80th percentile. It also configures histogram buckets to track and report the count of durations within specific intervals: from 0 to 100 milliseconds, 0 to 200 milliseconds, and 0 to 1 second. These intervals function as cumulative ranges, which is how the histogram buckets operate.

[source,xml]
----
mp.metrics.distribution.percentiles=alpha.timer=0.5,0.7,0.75,0.8
mp.metrics.distribution.timer.buckets=alpha.timer=100ms,200ms,1s
----

The corresponding Prometheus output for the `alpha.timer` metric at the `/metrics` REST endpoint is as follows.

[source,xml]
----
# HELP alpha_timer_seconds_max
# TYPE alpha_timer_seconds_max gauge
alpha_timer_seconds_max{scope="application",} 5.633
# HELP alpha_timer_seconds
# TYPE alpha_timer_seconds histogram <1>
alpha_timer_seconds{scope="application",quantile="0.5",} 0.67108864
alpha_timer_seconds{scope="application",quantile="0.7",} 5.603590144
alpha_timer_seconds{scope="application",quantile="0.75",} 5.603590144
alpha_timer_seconds{scope="application",quantile="0.8",} 5.603590144
alpha_timer_seconds_bucket{scope="application",le="0.1",} 0.0 <2>
alpha_timer_seconds_bucket{scope="application",le="0.2",} 0.0 <2>
alpha_timer_seconds_bucket{scope="application",le="1.0",} 1.0 <2>
alpha_timer_seconds_bucket{scope="application",le="+Inf",} 2.0 <2><3>
alpha_timer_seconds_count{scope="application",} 2.0
alpha_timer_seconds_sum{scope="application",} 6.333
----

<1> The Prometheus metric type is `histogram`, where both quantiles or percentiles, and buckets, are represented under this type.
<2> The `le` tag represents _less than_ and is for the defined buckets that are converted to seconds.
<3> Prometheus requires that a +Inf bucket that count all hits.

Also, the @RegistryScope annotation, suitable for use during metric registry injection, is now a CDI qualifier.

[#telemetry]
== Differences between MicroProfile Telemetry 1.0 and 1.1

MicroProfile Telemetry 1.1 provides developers with the latest Open Telemetry technology; the feature now consumes OpenTelemetry-1.29.0, updated from 1.19.0. Consequently, a lot of the dependencies are now stable. The feature is compatible with Java EE 7 with MicroProfile 1.4, Java EE 8 with MicroProfile 4.1, Jakarta EE 9 with MicroProfile 5.0 and Jakarta EE 10 with MicroProfile 6.1.
MicroProfile Telemetry 1.1 equips developers with the most recent Open Telemetry technology; this feature now uses OpenTelemetry-1.29.0, upgraded from 1.19.0. Therefore, a significant number of the dependencies are now stable.
This feature provides seamless integration with several environments. It is compatible with Java EE 7 and MicroProfile 1.4, and also Java EE 8 and MicroProfile 4.1. It also supports Jakarta EE 9 with MicroProfile 5.0, and Jakarta EE 10 paired with MicroProfile 6.1.

0 comments on commit df99f05

Please sign in to comment.