Skip to content

Commit 0ca10e7

Browse files
authored
Use versionless features (#269)
* use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * Update README.adoc * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> * use versionless feature Signed-off-by: Gilbert Kwan <[email protected]> --------- Signed-off-by: Gilbert Kwan <[email protected]>
1 parent 5d9e4bd commit 0ca10e7

File tree

8 files changed

+87
-67
lines changed

8 files changed

+87
-67
lines changed

Diff for: .github/workflows/test.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
canSkip: ${{ steps.Checker.outputs.canSkip }}
1313
steps:
1414
- name: Get files
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
- name: Get tools
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
with:
1919
path: tools/
2020
repository: openliberty/guides-common
@@ -45,10 +45,11 @@ jobs:
4545
working-directory: finish
4646

4747
steps:
48-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v4
4949
- name: Set up JDK 11
50-
uses: actions/setup-java@v1
50+
uses: actions/setup-java@v4
5151
with:
52+
distribution: 'semeru'
5253
java-version: 11
5354
- run: unset _JAVA_OPTIONS
5455

Diff for: README.adoc

+47-32
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018, 2024 IBM Corporation and others.
1+
// Copyright (c) 2018, 2025 IBM Corporation and others.
22
// Licensed under Creative Commons Attribution-NoDerivatives
33
// 4.0 International (CC BY-ND 4.0)
44
// https://creativecommons.org/licenses/by-nd/4.0/
@@ -96,34 +96,47 @@ See the following sample outputs for the `@Timed`, `@Gauge`, and `@Counted` metr
9696

9797
[role="no_copy"]
9898
----
99-
# TYPE application_inventoryProcessingTime_rate_per_second gauge
100-
application_inventoryProcessingTime_rate_per_second{method="get"} 0.0019189661542898407
99+
# TYPE inventoryProcessingTime_seconds_max gauge
100+
inventoryProcessingTime_seconds_max{method="list",mp_scope="application",} 3.0375E-5
101+
inventoryProcessingTime_seconds_max{method="get",mp_scope="application",} 0.1997325
102+
# HELP inventoryProcessingTime_seconds Time needed to process the inventory
103+
# TYPE inventoryProcessingTime_seconds summary
104+
inventoryProcessingTime_seconds{method="list",mp_scope="application",quantile="0.5",} 0.0
105+
inventoryProcessingTime_seconds{method="list",mp_scope="application",quantile="0.75",} 0.0
101106
...
102-
# TYPE application_inventoryProcessingTime_seconds summary
103-
# HELP application_inventoryProcessingTime_seconds Time needed to process the inventory
104-
application_inventoryProcessingTime_seconds_count{method="get"} 1
105-
application_inventoryProcessingTime_seconds{method="get",quantile="0.5"} 0.127965469
107+
inventoryProcessingTime_seconds_count{method="list",mp_scope="application",} 2.0
108+
inventoryProcessingTime_seconds_sum{method="list",mp_scope="application",} 3.6792E-5
109+
inventoryProcessingTime_seconds{method="get",mp_scope="application",quantile="0.5",} 0.0
110+
inventoryProcessingTime_seconds{method="get",mp_scope="application",quantile="0.75",} 0.0
106111
...
107-
# TYPE application_inventoryProcessingTime_rate_per_second gauge
108-
application_inventoryProcessingTime_rate_per_second{method="list"} 0.0038379320982686884
112+
inventoryProcessingTime_seconds_count{method="get",mp_scope="application",} 1.0
113+
inventoryProcessingTime_seconds_sum{method="get",mp_scope="application",} 0.1997325
109114
...
110-
# TYPE application_inventoryProcessingTime_seconds summary
111-
# HELP application_inventoryProcessingTime_seconds Time needed to process the inventory
112-
application_inventoryProcessingTime_seconds_count{method="list"} 2
113-
application_inventoryProcessingTime_seconds{method="list",quantile="0.5"} 2.2185000000000002E-5
115+
# HELP inventoryAddingTime_seconds_max Time needed to add system properties to the inventory
116+
# TYPE inventoryAddingTime_seconds_max gauge
117+
inventoryAddingTime_seconds_max{mp_scope="application",} 3.1E-5
118+
# HELP inventoryAddingTime_seconds Time needed to add system properties to the inventory
119+
# TYPE inventoryAddingTime_seconds summary
120+
inventoryAddingTime_seconds{mp_scope="application",quantile="0.5",} 0.0
121+
inventoryAddingTime_seconds{mp_scope="application",quantile="0.75",} 0.0
122+
...
123+
inventoryAddingTime_seconds_count{mp_scope="application",} 1.0
124+
inventoryAddingTime_seconds_sum{mp_scope="application",} 3.1E-5
114125
...
115126
----
127+
116128
[role="no_copy"]
117129
----
118-
# TYPE application_inventorySizeGauge gauge
119-
# HELP application_inventorySizeGauge Number of systems in the inventory
120-
application_inventorySizeGauge 1
130+
# HELP inventorySizeGauge Number of systems in the inventory
131+
# TYPE inventorySizeGauge gauge
132+
inventorySizeGauge{mp_scope="application",} 1.0
121133
----
134+
122135
[role="no_copy"]
123136
----
124-
# TYPE application_inventoryAccessCount_total counter
125-
# HELP application_inventoryAccessCount_total Number of times the list of systems method is requested
126-
application_inventoryAccessCount_total 1
137+
# HELP inventoryAccessCount_total Number of times the list of systems method is requested
138+
# TYPE inventoryAccessCount_total counter
139+
inventoryAccessCount_total{mp_scope="application",} 2.0
127140
----
128141

129142
// static guide instructions:
@@ -143,15 +156,15 @@ See the following sample output:
143156

144157
[role="no_copy"]
145158
----
146-
# TYPE base_jvm_uptime_seconds gauge
147-
# HELP base_jvm_uptime_seconds Displays the start time of the Java virtual machine in milliseconds. This attribute displays the approximate time when the Java virtual machine started.
148-
base_jvm_uptime_seconds 30.342000000000002
159+
# HELP jvm_uptime_seconds Displays the time from the start of the Java virtual machine in seconds.
160+
# TYPE jvm_uptime_seconds gauge
161+
jvm_uptime_seconds{mp_scope="base",} 730.705
149162
----
150163
[role="no_copy"]
151164
----
152-
# TYPE base_classloader_loadedClasses_count gauge
153-
# HELP base_classloader_loadedClasses_count Displays the number of classes that are currently loaded in the Java virtual machine.
154-
base_classloader_loadedClasses_count 11231
165+
# HELP classloader_loadedClasses_count Displays the number of classes that are currently loaded in the Java virtual machine.
166+
# TYPE classloader_loadedClasses_count gauge
167+
classloader_loadedClasses_count{mp_scope="base",} 13033.0
155168
----
156169

157170
// static guide instructions:
@@ -171,15 +184,17 @@ See the following sample output:
171184

172185
[role="no_copy"]
173186
----
174-
# TYPE vendor_threadpool_size gauge
175-
# HELP vendor_threadpool_size The size of the thread pool.
176-
vendor_threadpool_size{pool="Default_Executor"} 32
187+
# HELP threadpool_size The size of the thread pool.
188+
# TYPE threadpool_size gauge
189+
threadpool_size{mp_scope="vendor",pool="Default_Executor",} 24.0
177190
----
178191
[role="no_copy"]
179192
----
180-
# TYPE vendor_servlet_request_total counter
181-
# HELP vendor_servlet_request_total The number of visits to this servlet from the start of the server.
182-
vendor_servlet_request_total{servlet="microprofile_metrics_io_openliberty_guides_inventory_InventoryApplication"} 1
193+
# HELP servlet_request_total The number of visits to this servlet ... the start of the server.
194+
# TYPE servlet_request_total counter
195+
servlet_request_total{mp_scope="vendor",servlet="guide_microprofile_metrics_io_openliberty_guides_system_SystemApplication",} 1.0
196+
servlet_request_total{mp_scope="vendor",servlet="guide_microprofile_metrics_io_openliberty_guides_inventory_InventoryApplication",} 3.0
197+
servlet_request_total{mp_scope="vendor",servlet="io_openliberty_microprofile_metrics_5_0_private_internal_PrivateMetricsRESTProxyServlet",} 3.0
183198
----
184199

185200
include::{common-includes}/twyb-end.adoc[]
@@ -277,7 +292,7 @@ Apply the [hotspot=gaugeForGetTotal]`@Gauge` annotation to the [hotspot=getTotal
277292
|===
278293

279294
Additional information about these annotations, relevant metadata fields, and more are available at
280-
the https://openliberty.io/docs/latest/reference/javadoc/microprofile-6.1-javadoc.html?class=org/eclipse/microprofile/metrics/annotation/package-summary.html&package=allclasses-frame.html[MicroProfile Metrics Annotation Javadoc^].
295+
the https://openliberty.io/docs/latest/reference/javadoc/microprofile-6.1-javadoc.html?class=org/eclipse/microprofile/metrics/annotation/package-summary.html&package=allclasses-frame.html&path=microprofile-6.1-javadoc/org/eclipse/microprofile/metrics/annotation/package-summary.html[MicroProfile Metrics Annotation Javadoc^].
281296

282297

283298
== Enabling vendor metrics for the microservices

Diff for: finish/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!-- tag::microprofile[] -->
3232
<artifactId>microprofile</artifactId>
3333
<!-- end::microprofile[] -->
34-
<version>6.1</version>
34+
<version>7.0</version>
3535
<type>pom</type>
3636
<scope>provided</scope>
3737
</dependency>

Diff for: finish/src/main/liberty/config/server.xml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<server description="Sample Liberty server">
22

33
<featureManager>
4-
<feature>restfulWS-3.1</feature>
5-
<feature>jsonp-2.1</feature>
6-
<feature>jsonb-3.0</feature>
7-
<feature>cdi-4.0</feature>
8-
<feature>mpConfig-3.1</feature>
9-
<feature>mpMetrics-5.1</feature>
10-
<feature>mpRestClient-3.0</feature>
4+
<platform>jakartaee-10.0</platform>
5+
<platform>microprofile-7.0</platform>
6+
<feature>restfulWS</feature>
7+
<feature>jsonp</feature>
8+
<feature>jsonb</feature>
9+
<feature>cdi</feature>
10+
<feature>mpConfig</feature>
11+
<feature>mpMetrics</feature>
12+
<feature>mpRestClient</feature>
1113
</featureManager>
1214

1315
<variable name="http.port" defaultValue="9080"/>

Diff for: finish/src/main/webapp/index.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ <h2>Eclipse MicroProfile</h2>
3030
<p>
3131
For more information about the features used in this application, see the Open Liberty documentation:
3232
<ul>
33-
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile-6.1.html">MicroProfile 6.1</a></li>
34-
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS-3.1.html">Jakarta RESTful Web Services 3.1</a></li>
35-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonp-2.1.html">Jakarta JSON Processing 2.1</a></li>
36-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html">Jakarta JSON Binding 3.0</a></li>
37-
<li><a href="https://openliberty.io/docs/ref/feature/#cdi-4.0.html">Jakarta Contexts and Dependency Injection 4.0</a></li>
38-
<li><a href="https://openliberty.io/docs/ref/feature/#mpMetrics-5.1.html">MicroProfile Metrics 5.1</a></li>
39-
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient-3.0.html">MicroProfile Rest Client 3.0</a></li>
40-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding 3.0</a></li>
33+
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile.html">MicroProfile</a></li>
34+
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS.html">Jakarta RESTful Web Services</a></li>
35+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonp.html">Jakarta JSON Processing</a></li>
36+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb.html">Jakarta JSON Binding</a></li>
37+
<li><a href="https://openliberty.io/docs/ref/feature/#cdi.html">Jakarta Contexts and Dependency Injection</a></li>
38+
<li><a href="https://openliberty.io/docs/ref/feature/#mpMetrics.html">MicroProfile Metrics</a></li>
39+
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient.html">MicroProfile Rest Client</a></li>
40+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding</a></li>
4141
</ul>
4242
</p>
4343
</div>

Diff for: start/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!-- tag::microprofile[] -->
3232
<artifactId>microprofile</artifactId>
3333
<!-- end::microprofile[] -->
34-
<version>6.1</version>
34+
<version>7.0</version>
3535
<type>pom</type>
3636
<scope>provided</scope>
3737
</dependency>

Diff for: start/src/main/liberty/config/server.xml

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<server description="Sample Liberty server">
22

33
<featureManager>
4-
<feature>restfulWS-3.1</feature>
5-
<feature>jsonp-2.1</feature>
6-
<feature>jsonb-3.0</feature>
7-
<feature>cdi-4.0</feature>
8-
<feature>mpConfig-3.1</feature>
9-
<feature>mpRestClient-3.0</feature>
4+
<platform>jakartaee-10.0</platform>
5+
<platform>microprofile-7.0</platform>
6+
<feature>restfulWS</feature>
7+
<feature>jsonp</feature>
8+
<feature>jsonb</feature>
9+
<feature>cdi</feature>
10+
<feature>mpConfig</feature>
11+
<feature>mpRestClient</feature>
1012
</featureManager>
1113

1214
<variable name="http.port" defaultValue="9080"/>

Diff for: start/src/main/webapp/index.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ <h2>Eclipse MicroProfile</h2>
3030
<p>
3131
For more information about the features used in this application, see the Open Liberty documentation:
3232
<ul>
33-
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile-6.1.html">MicroProfile 6.1</a></li>
34-
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS-3.1.html">Jakarta RESTful Web Services 3.1</a></li>
35-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonp-2.1.html">Jakarta JSON Processing 2.1</a></li>
36-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html">Jakarta JSON Binding 3.0</a></li>
37-
<li><a href="https://openliberty.io/docs/ref/feature/#cdi-4.0.html">Jakarta Contexts and Dependency Injection 4.0</a></li>
38-
<li><a href="https://openliberty.io/docs/ref/feature/#mpMetrics-5.1.html">MicroProfile Metrics 5.1</a></li>
39-
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient-3.0.html">MicroProfile Rest Client 3.0</a></li>
40-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding 3.0</a></li>
33+
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile.html">MicroProfile</a></li>
34+
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS.html">Jakarta RESTful Web Services</a></li>
35+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonp.html">Jakarta JSON Processing</a></li>
36+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb.html">Jakarta JSON Binding</a></li>
37+
<li><a href="https://openliberty.io/docs/ref/feature/#cdi.html">Jakarta Contexts and Dependency Injection</a></li>
38+
<li><a href="https://openliberty.io/docs/ref/feature/#mpMetrics.html">MicroProfile Metrics</a></li>
39+
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient.html">MicroProfile Rest Client</a></li>
40+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding</a></li>
4141
</ul>
4242
</p>
4343
</div>

0 commit comments

Comments
 (0)