back to all blogsSee all blog posts

New vendor metrics for MicroProfile Metrics in Open Liberty 23.0.0.11

image of author
Laura Cowen on Nov 14, 2023
Post available in languages: 日本語 ,

Open Liberty 23.0.0.11 includes new vendor metrics for MicroProfile Metrics that you can add directly to your dashboards in various monitoring tools, without any additional computation on your part. Also announced in this release, but available since 23.0.0.10, is the ability to include all files in a specified directory in your server configuration. And there’s a security fix.

In Open Liberty 23.0.0.11:

View the list of fixed bugs in 23.0.0.11.

Develop and run your apps using 23.0.0.11

Open Liberty 23.0.0.11 is available through Maven, Gradle, Docker, and as a downloadable archive.

Ask a question on Stack Overflow

New vendor metrics for MicroProfile Metrics 3.0, 4.0, 5.0

This update to MicroProfile Metrics 3.0 (mpMetrics-3.0), 4.0 (mpMetrics-4.0), and 5.0 (mpMetrics-5.0) on Open Liberty includes some new vendor metrics at the /metrics endpoint.

Previously, you could calculate the new metrics for yourself from the Time and Total counts that were already provided for various monitoring components. For example, to obtain a "response time per request" metric, you would calculate it using the array of time series data provided by the MicroProfile Metrics feature. However, not all monitoring tools support such complex time series expressions.

With the MicroProfile Metrics feature, you can use the new metrics directly in the dashboards of various monitoring tools, without any additional computation.

The following table lists the new vendor metrics:

Metric Endpoint output (Prometheus format)

MicroProfile Metrics 5.0

MicroProfile Metrics 3.0 & 4.0

Process CPU Utilization Percent

# HELP cpu_processCpuUtilization_percent The recent CPU time that is used by the JVM process from all processors that are available to the JVM. The value is between 0 and 1.
# TYPE cpu_processCpuUtilization_percent gauge cpu_processCpuUtilization_percent{mp_scope="vendor",} 0.03710604254625131

# TYPE vendor_cpu_processCpuUtilization_percent gauge
# HELP vendor_cpu_processCpuUtilization_percent The recent CPU time that is used by the JVM process from all processors that are available to the JVM. The value is between 0 and 1. vendor_cpu_processCpuUtilization_percent 0.03721734429065744

Heap Utilization Percent

# HELP memory_heapUtilization_percent The portion of the maximum heap memory that is currently in use. This metric displays -1 if the maximum heap memory size is unknown. The value is between 0 and 1.+ # TYPE memory_heapUtilization_percent gauge memory_heapUtilization_percent{mp_scope="vendor",} 0.007193807512521744

# TYPE vendor_memory_heapUtilization_percent gauge
# HELP vendor_memory_heapUtilization_percent The portion of the maximum heap memory that is currently in use. This metric displays -1 if the maximum heap memory size is unknown. The value is between 0 and 1. vendor_memory_heapUtilization_percent 0.0061398036777973175

GC Time per Cycle

# HELP gc_time_per_cycle_seconds The recent average time spent per garbage collection cycle. This metric displays -1 if the garbage collection elapsed time or count is unknown for this collector.
# TYPE gc_time_per_cycle_seconds gauge gc_time_per_cycle_seconds{mp_scope="vendor",name="global",} 0.005

# TYPE vendor_gc_time_per_cycle_seconds gauge
# HELP vendor_gc_time_per_cycle_seconds The recent average time spent per garbage collection cycle. This metric displays -1 if the garbage collection elapsed time or count is unknown for this collector. vendor_gc_time_per_cycle_seconds{name="global"} 0.004385714285714285

Connection Pool in Use Time per Used Connection

# HELP connectionpool_inUseTime_per_usedConnection_seconds The recent average time that connections are in use.
# TYPE connectionpool_inUseTime_per_usedConnection_seconds gauge connectionpool_inUseTime_per_usedConnection_seconds{datasource="jdbc_exampleDS1",mp_scope="vendor",} 0.497

# TYPE vendor_connectionpool_inUseTime_per_usedConnection_seconds gauge
# HELP vendor_connectionpool_inUseTime_per_usedConnection_seconds The recent average time that connections are in use. vendor_connectionpool_inUseTime_per_usedConnection_seconds{datasource="jdbc_exampleDS1"} 0.743

Connection Pool Wait Time per Queued Request

# HELP connectionpool_waitTime_per_queuedRequest_seconds The recent average wait time for queued connection requests.
# TYPE connectionpool_waitTime_per_queuedRequest_seconds gauge connectionpool_waitTime_per_queuedRequest_seconds{datasource="jdbc_exampleDS1",mp_scope="vendor",} 35.0

# TYPE vendor_connectionpool_waitTime_per_queuedRequest_seconds gauge
# HELP vendor_connectionpool_waitTime_per_queuedRequest_seconds The recent average wait time for queued connection requests. vendor_connectionpool_waitTime_per_queuedRequest_seconds{datasource="jdbc_exampleDS1"} 45.0

Servlet Elapsed Time per Request

# HELP servlet_request_elapsedTime_per_request_seconds The recent average elapsed response time per servlet request.
# TYPE servlet_request_elapsedTime_per_request_seconds gauge servlet_request_elapsedTime_per_request_seconds{mp_scope="vendor",servlet=”myapp_servletA",} 0.001256676333333333 servlet_request_elapsedTime_per_request_seconds{mp_scope="vendor",servlet=" myapp_servletB",} 0.00372855566666666 servlet_request_elapsedTime_per_request_seconds{mp_scope="vendor",servlet=" myapp_servletC",} 1.731813674

# TYPE vendor_servlet_request_elapsedTime_per_request_seconds gauge
# HELP vendor_servlet_request_elapsedTime_per_request_seconds The recent average elapsed response time per servlet request. vendor_servlet_request_elapsedTime_per_request_seconds{servlet=”myapp_servletA",} 0.36816000695238094 vendor_servlet_request_elapsedTime_per_request_seconds{servlet=" myapp_servletB",} 0.384967335 vendor_servlet_request_elapsedTime_per_request_seconds{servlet=" myapp_servletC",} 1.333671328

REST Elapsed Time per Request

# HELP REST_request_elapsedTime_per_request_seconds The recent average elapsed response time per RESTful resource method request.
# TYPE REST_request_elapsedTime_per_request_seconds gauge REST_request_elapsedTime_per_request_seconds{class=”my.package.MyClass",method=”simpleGet",mp_scope=”vendor"} 0.0061460695

# TYPE vendor_REST_request_elapsedTime_per_request_seconds gauge
# HELP vendor_REST_request_elapsedTime_per_request_seconds The recent average elapsed response time per RESTful resource method request. vendor_REST_request_elapsedTime_per_request_seconds{class=”my.package.MyClass",method=”simpleGet"} 0.0024352581

The Heap Utilization and CPU Utilization metrics are available when the server is started. The Connection Pool, REST, and Servlet metrics are available if the application contains any of the relevant data sources, REST APIs, or servlets, as is the case with the existing vendor metrics.

The new vendor metrics are available in the /metrics output when you enable the relevant Microprofile Metrics feature (version 3.0, 4.0, or 5.0) in your server.xml; for example:

<featureManager>
   <feature>mpMetrics-5.0</feature>
</featureManager>

For more information, see:

Include all files in a specified directory in your server configuration

You can use the include element in your server.xml file to specify the location of files to include in your server configuration. In previous releases, you had to specify the location for each include file individually. Starting with the 23.0.0.10 release, you can place all the included files in a directory and just specify the directory location in the include element.

This is important because when running on Kubernetes, mounting secrets as a whole folder is the only way to reflect the change from the secret dynamically in the running pod.

In the location attribute of the include element of the server.xml file, enter the directory that contains your configuration files. For example:

    <include location="./common/"/>

After you make the changes, you can see the following output in the log:

[AUDIT   ] CWWKG0028A: Processing included configuration resource: /Users/rickyherget/libertyGit/open-liberty/dev/build.image/wlp/usr/servers/com.ibm.ws.config.include.directory/common/a.xml
[AUDIT   ] CWWKG0028A: Processing included configuration resource: /Users/rickyherget/libertyGit/open-liberty/dev/build.image/wlp/usr/servers/com.ibm.ws.config.include.directory/common/b.xml
[AUDIT   ] CWWKG0028A: Processing included configuration resource: /Users/rickyherget/libertyGit/open-liberty/dev/build.image/wlp/usr/servers/com.ibm.ws.config.include.directory/common/c.xml

The files in the directory are processed in alphabetical order and subdirectories are ignored.

For more information about Liberty configuration includes, see Include configuration docs.

Security vulnerability (CVE) fixes in this release

CVE CVSS Score Vulnerability Assessment Versions Affected Notes

CVE-2023-46158

4.9

Weaker security

23.0.0.9 - 23.0.0.10

Affects the Application Security 1.0, Application Security 2.0, Application Security 3.0, Application Security 4.0 and Application Security 5.0 features.

For a list of past security vulnerability fixes, reference the Security vulnerability (CVE) list.

Get Open Liberty 23.0.0.11 now

If you’re using Maven, include the following in your pom.xml file:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <version>3.9</version>
</plugin>

Or for Gradle, include the following in your build.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.openliberty.tools:liberty-gradle-plugin:3.7'
    }
}
apply plugin: 'liberty'

Or if you’re using container images:

FROM icr.io/appcafe/open-liberty

Or take a look at our Downloads page.

If you’re using IntelliJ IDEA, Visual Studio Code or Eclipse IDE, you can also take advantage of our open source Liberty developer tools to enable effective development, testing, debugging and application management all from within your IDE.

Ask a question on Stack Overflow