Skip to content

Commit

Permalink
Merge pull request #4004 from OpenLiberty/staging
Browse files Browse the repository at this point in the history
Publish 24.0.0.9-beta release blog post
  • Loading branch information
dmuelle authored Aug 27, 2024
2 parents cda8ede + 6e4135e commit ea33cae
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 8 deletions.
15 changes: 9 additions & 6 deletions blog_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"blog_tags": [
{
"name": "announcements",
"posts": ["liberty-developer-essentials-badge",
"posts": ["24.0.0.9-beta", "liberty-developer-essentials-badge",
"24.0.0.8", "24.0.0.8-beta",
"24.0.0.7", "24.0.0.7-beta",
"24.0.0.6", "24.0.0.6-beta",
Expand Down Expand Up @@ -82,7 +82,7 @@
"featured": "true"
},{
"name": "microprofile",
"posts": ["liberty-on-amazon-ecs",
"posts": ["24.0.0.9-beta", "liberty-on-amazon-ecs",
"24.0.0.8", "liberty-developer-essentials-badge",
"24.0.0.8-beta", "24.0.0.7",
"24.0.0.7-beta", "24.0.0.6-beta",
Expand Down Expand Up @@ -166,7 +166,8 @@
},
{
"name": "release",
"posts": ["24.0.0.8", "24.0.0.8-beta",
"posts": ["24.0.0.9-beta",
"24.0.0.8", "24.0.0.8-beta",
"24.0.0.7", "24.0.0.7-beta",
"24.0.0.6", "24.0.0.6-beta",
"24.0.0.5", "24.0.0.5-beta",
Expand Down Expand Up @@ -227,7 +228,8 @@
},
{
"name": "beta",
"posts": ["24.0.0.8-beta", "24.0.0.7-beta",
"posts": ["24.0.0.9-beta",
"24.0.0.8-beta", "24.0.0.7-beta",
"24.0.0.6-beta", "24.0.0.5-beta",
"24.0.0.4-beta", "24.0.0.2-beta",
"24.0.0.1-beta", "23.0.0.12-beta",
Expand Down Expand Up @@ -342,7 +344,7 @@
},
{
"name": "metrics",
"posts": ["24.0.0.8-beta",
"posts": ["24.0.0.9-beta", "24.0.0.8-beta",
"24.0.0.7", "24.0.0.7-beta",
"24.0.0.6-beta", "23.0.0.12",
"23.0.0.11", "23.0.0.11-beta",
Expand Down Expand Up @@ -529,7 +531,8 @@
},
{
"name": "monitoring",
"posts": ["24.0.0.8", "24.0.0.8-beta",
"posts": ["24.0.0.9-beta",
"24.0.0.8", "24.0.0.8-beta",
"24.0.0.7-beta", "24.0.0.3",
"Primeur", "23.0.0.3",
"tracing-with-microprofile-telemetry", "separate-stack-trace-22008",
Expand Down
4 changes: 2 additions & 2 deletions posts/2022-07-06-user-feature-install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ For details about the format of a feature manifest file, see link:https://www.ib
</build>
</project>
----
By default, it will not generate the manifest file, so we have to set the `generateManifest` header to *true*. To install the feature on to the Open Liberty runtime, we need to set the *visibility* directive to "public". We can do so by setting the `Subsystem-SymbolicName` header to "_Bundle-SymbolicName;visibility:=public_". If the *visibility* is set to `protected|private`, the Liberty Maven Plugin can't resolve the feature. Also, the plugin automatically creates the mandatory `Subsystem-Content` header. `IBM-ShortName` is an optional header alias to `Subsystem-SymbolicName`.
By default, it will not generate the manifest file, so we have to set the `generateManifest` header to *true*. To install the feature on to the Open Liberty runtime, we need to set the *visibility* directive to "public". We can do so by setting the `Subsystem-SymbolicName` header to "_Subsystem-SymbolicName;visibility:=public_". If the *visibility* is set to `protected|private`, the Liberty Maven Plugin can't resolve the feature. Also, the plugin automatically creates the mandatory `Subsystem-Content` header. `IBM-ShortName` is an optional header alias to `Subsystem-SymbolicName`.

Run `mvn clean install` to create an ESA file. Inside the ESA file, you will find your bundle JAR and SUBSYSTEM.MF files.

.SUBSYSTEM.MF
[source, txt]
----
Subsystem-ManifestVersion: 1
Subsystem-SymbolicName: com.example.bundle.Activator;visibility:=public
Subsystem-SymbolicName: com.example.feature.SimpleActivator;visibility:=public
Subsystem-Version: 1.0.0
Subsystem-Name: SimpleActivatorESA
Subsystem-Content: com.example.bundle.Activator;version="[1.0.0,1.0.0]"
Expand Down
2 changes: 2 additions & 0 deletions posts/2024-08-13-24.0.0.8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ This example enables versionless MicroProfile features with `microProfile-5.0` s
</featureManager>
----

Note: The Liberty Maven and Gradle build plugins do not yet support versionless features or platform definitions.

Learn more and check out the full collection of available platforms and versionless features in the link:{url-prefix}/docs/latest/reference/feature/versionless-features.html[Open Liberty docs]. Stay tuned for more versionless features and platforms in future releases.

// // // // DO NOT MODIFY THIS COMMENT BLOCK <GHA-BLOG-TOPIC> // // // //
Expand Down
226 changes: 226 additions & 0 deletions posts/2024-08-27-24.0.0.9-beta.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
---
layout: post
title: "Send logs and metrics to OpenTelemetry in 24.0.0.9-beta"
# Do NOT change the categories section
categories: blog
author_picture: https://avatars3.githubusercontent.com/dmuelle
author_github: https://github.com/dmuelle
seo-title: Send logs and metrics to OpenTelemetry in 24.0.0.9-beta - OpenLiberty.io
seo-description: In this release, the MicroProfile Telemetry 2.0 beta feature helps improve the observability of your Java applications by using OpenTelemetry to collect and export logs, metrics, and traces in a standardized way. A minor update for the WebSocket 2.2 beta feature is also included.
blog_description: In this release, the MicroProfile Telemetry 2.0 beta feature helps improve the observability of your Java applications by using OpenTelemetry to collect and export logs, metrics, and traces in a standardized way. A minor update for the WebSocket 2.2 beta feature is also included.
open-graph-image: https://openliberty.io/img/twitter_card.jpg
open-graph-image-alt: Open Liberty Logo
---
= Send logs and metrics to OpenTelemetry in 24.0.0.9-beta
David Mueller <https://github.com/dmuelle>
:imagesdir: /
:url-prefix:
:url-about: /
//

In this release, the MicroProfile Telemetry 2.0 beta feature helps improve the observability of your Java applications by using OpenTelemetry to collect and export logs, metrics, and traces in a standardized way. A minor update for the WebSocket 2.2 beta feature is also included.

The link:{url-about}[Open Liberty] 24.0.0.9-beta includes the following beta features (along with link:{url-prefix}/docs/latest/reference/feature/feature-overview.html[all GA features]):

* <<metrics, Send Liberty metrics to OpenTelemetry>>
* <<logs, Send logs to OpenTelemetry>>
* <<websocket, Jakarta EE11 WebSocket 2.2>>


See also link:{url-prefix}/blog/?search=beta&key=tag[previous Open Liberty beta blog posts].

// // // // DO NOT MODIFY THIS COMMENT BLOCK <GHA-BLOG-TOPIC> // // // //
// Blog issue: https://github.com/OpenLiberty/open-liberty/issues/29456
// Contact/Reviewer: Channyboy
// // // // // // // //
[#metrics]
== Send Liberty metrics to OpenTelemetry

MicroProfile Telemetry 2.0 provides the latest OpenTelemetry technology. In addition to link:{url-prefix}/docs/latest/microprofile-telemetry.html[distributed tracing], the feature now allows OpenTelemetry to collect and export metrics and logs.

When the MicroProfile Telemetry 2.0 beta feature (`mpTelemetry-2.0`) is enabled, Open Liberty can now forward runtime component statistics that are captured by the link:{url-prefix}/docs/latest/reference/feature/monitor-1.0.html[Performance Monitoring 1.0] feature (`monitor-1.0`) to the MicroProfile Telemetry 2.0 runtime. This statistical data is registered as metrics in the telemetry runtime and can then be forwarded to any OpenTelemetry Protocol (OTLP) compatible metric consumer to meet your monitoring needs.

The following runtime components are supported:

* `ThreadPool`
* `Sessions`
* `RequestTiming`
* `ConnectionPool`

To collect and export metrics, enable OpenTelemetry by using the following system property or environment variable:

* System property: `otel.sdk.disabled=false`
* Environment variable: `OTEL_SDK_DISABLED=false`

You can set configuration properties in any of the link:{url-prefix}/docs/latest/external-configuration.html#default[config sources that are available to MicroProfile Config].


Enable the `mpTelemetry-2.0` feature and any features that are associated with your chosen supported runtime components. The `mpTelemetry-2.0` feature automatically enables the `monitor-1.0` feature.

For example, the `ConnectionPool` component requires the following configuration:

[source,xml]
----
<featureManager>
<feature>mpTelemetry-2.0</feature>
<feature>jdbc-4.3</feature>
</featureManager>
----


By default, all OpenTelemetry data is exported to link:https://opentelemetry.io/docs/languages/java/exporters/#otlp[OTLP]. You can set a different exporter by specifying the following system property or environment variable:

* System property: `otel.metrics.exporter`
* Environment variable: `OTEL_METRICS_EXPORTER`

You can also optionally configure the metric export interval configuration variable. The value is specified in milliseconds and the default is 60000 (60 seconds).

* System property: `otel.metric.export.interval`
* Environment variable: `OTEL_METRIC_EXPORT_INTERVAL`

For more information about the available configuration properties, see xref:{url-prefix}/docs/latest/microprofile-config-properties.html#telemetry[MicroProfile Config properties: MicroProfile Telemetry].

// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>

// // // // DO NOT MODIFY THIS COMMENT BLOCK <GHA-BLOG-TOPIC> // // // //
// Blog issue: https://github.com/OpenLiberty/open-liberty/issues/29332
// Contact/Reviewer: pgunapal
// // // // // // // //
[#logs]
== Send logs to OpenTelemetry

The `mpTelemetry-2.0` feature can now collect Open Liberty runtime log sources (messages, traces, ffdcs) and application logs generated through the `java.util.logging` package (JUL).

To enable the MicroProfile Telemetry 2.0 feature to collect all logs, add the following configuration to your `server.xml` file:

[source,xml]
----
<features>
<feature>mpTelemetry-2.0</feature>
</features>
<mpTelemetry source="message, trace, ffdc"/>
----

If the `mpTelemetry` configuration element or the `source` attribute is not configured, the `message` source is set by default. In this case, only messages are collected. If the `source` attribute is specified empty (`source=""`), no logs are sent to OpenTelemetry.

To collect and export runtime-level logs, enable OpenTelemetry by using the following system property or environment variable:

* System property: `otel.sdk.disabled=false`
* Environment variable: `OTEL_SDK_DISABLED=false`

You can set configuration properties in any of the link:{url-prefix}/docs/latest/external-configuration.html#default[config sources that are available to MicroProfile Config].

To separately configure multiple applications in a server, you can configure OpenTelemetry with application configuration. However, you cannot collect runtime-level logs this way.

By default, all OpenTelemetry data is exported to link:https://opentelemetry.io/docs/languages/java/exporters/#otlp[OTLP]. You can set a different exporter by specifying the following system property or environment variable:

* System property: `otel.logs.exporter`
* Environment variable: `OTEL_LOGS_EXPORTER`

For more information about the available configuration properties, see xref:{url-prefix}/docs/latest/microprofile-config-properties.html#telemetry[MicroProfile Config properties: MicroProfile Telemetry].

// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>

// // // // DO NOT MODIFY THIS COMMENT BLOCK <GHA-BLOG-TOPIC> // // // //
// Blog issue: https://github.com/OpenLiberty/open-liberty/issues/29223
// Contact/Reviewer: volosied,pnicolucci
// // // // // // // //
[#websocket]
== Avoid type errors with WebSocket 2.2

To avoid type errors, this beta release of the WebSocket 2.2 feature (`websocket-2.2`) limits the link:https://jakarta.ee/specifications/websocket/2.2/apidocs/server/jakarta/websocket/onmessage#maxMessageSize()[MaxMessageSize] to `Integer#MAX_VALUE` for the `OnMessage` annotation. The websocket-2.2 feature was previously released in beta in the 24.0.0.8-beta.


To enable this beta feature, add the following code to your `server.xml` file.

[source,xml]
----
<featureManager>
<feature>websocket-2.2</feature>
</featureManager>
----
For more information, such as the Javadoc, specification documents, and other details, see link:https://jakarta.ee/specifications/websocket/2.2/[Jakarta WebSocket 2.2].


// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>


[#run]
=== Try it now

To try out these features, update your build tools to pull the Open Liberty All Beta Features package instead of the main release. The beta works with Java SE 22, Java SE 21, Java SE 17, Java SE 11, and Java SE 8.

If you're using link:{url-prefix}/guides/maven-intro.html[Maven], you can install the All Beta Features package using:

[source,xml]
----
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.10.3</version>
<configuration>
<runtimeArtifact>
<groupId>io.openliberty.beta</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>24.0.0.9-beta</version>
<type>zip</type>
</runtimeArtifact>
</configuration>
</plugin>
----

You must also add dependencies to your pom.xml file for the beta version of the APIs that are associated with the beta features that you want to try. For example, the following block adds dependencies for two example beta APIs:

[source,xml]
----
<dependency>
<groupId>org.example.spec</groupId>
<artifactId>exampleApi</artifactId>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>example.platform</groupId>
<artifactId>example.example-api</artifactId>
<version>11.0.0</version>
<scope>provided</scope>
</dependency>
----

Or for link:{url-prefix}/guides/gradle-intro.html[Gradle]:

[source,gradle]
----
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.openliberty.tools:liberty-gradle-plugin:3.8.3'
}
}
apply plugin: 'liberty'
dependencies {
libertyRuntime group: 'io.openliberty.beta', name: 'openliberty-runtime', version: '[24.0.0.9-beta,)'
}
----

Or if you're using link:{url-prefix}/docs/latest/container-images.html[container images]:

[source]
----
FROM icr.io/appcafe/open-liberty:beta
----

Or take a look at our link:{url-prefix}/downloads/#runtime_betas[Downloads page].

If you're using link:https://plugins.jetbrains.com/plugin/14856-liberty-tools[IntelliJ IDEA], link:https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext[Visual Studio Code] or link:https://marketplace.eclipse.org/content/liberty-tools[Eclipse IDE], you can also take advantage of our open source link:https://openliberty.io/docs/latest/develop-liberty-tools.html[Liberty developer tools] to enable effective development, testing, debugging, and application management all from within your IDE.

For more information on using a beta release, refer to the link:{url-prefix}/docs/latest/installing-open-liberty-betas.html[Installing Open Liberty beta releases] documentation.

[#feedback]
== We welcome your feedback

Let us know what you think on link:https://groups.io/g/openliberty[our mailing list]. If you hit a problem, link:https://stackoverflow.com/questions/tagged/open-liberty[post a question on StackOverflow]. If you hit a bug, link:https://github.com/OpenLiberty/open-liberty/issues[please raise an issue].

0 comments on commit ea33cae

Please sign in to comment.