WildFly, Micrometer, and OpenTelemetryMonday, May 15, 2023 |
With the release of WildFly 28, we’ve made a few changes to our supported telemetry libraries that are worth noting. In this post, I’ll give a quick overview of those changes.
Perhaps the more pressing/disruptive is that we’ve removed support for MicroProfile OpenTracing and MicroProfile Metrics. MP OT itself has been deprecated/replaced by the working group with MicroProfile Telemetry. MP Metrics, though, continues to evolve in ways to which Red Hat objects, so support for that specification has been removed completely.
The more interesting changes are the addition (or modification) of two other libraries: Micrometer and OpenTelemetry (both of which I’ve written about before here and here). Both of these new subsystems are disabled by default (to avoid any unwanted potential performance impacts), so I’ll show how to enable them:
1 2 3 4 5 6 7 8 9 10 $ jboss-cli.sh -c <<EOF if (outcome != success) of /extension=org.wildfly.extension.micrometer:read-resource /extension=org.wildfly.extension.micrometer:add end-if if (outcome != success) of /subsystem=micrometer:read-resource /subsystem=micrometer:add(endpoint="http://localhost:4318/v1/metrics") reload end-if EOF
1 2 3 4 5 6 7 8 9 10 $ jboss-cli.sh -c <<EOF if (outcome != success) of /extension=org.wildfly.extension.opentelemetry:read-resource /extension=org.wildfly.extension.opentelemetry:add() end-if if (outcome != success) of /subsystem=opentelemetry:read-resource /subsystem=opentelemetry:add() reload end-if EOF
Both of these scripts will safely add both the extension and then the subsystem only if needed, and reload the server (if needed). Once the server is up, you’re ready to deploy your application using either or both of these libraries.
One related technology worth noting is MicroProfile Telemetry. This new spec, which replaced MicroProfile OpenTracing, is enabled by default in the various MicroProfile configurations shipped with WildFly, so all you need to do is start the server with one of thse configurations:
standalone.sh -c standalone-microprofile.xml.
A very important note, though, is that enabling MicroProfile Telemetry (either by default or explicitly) changes the default behavior of the OpenTelemetry subsystem. The MP Telemetry spec dictates that the OpenTelemetry functionality be disabled unless explicitly enabled. To address that, make sure you add
If you want more information on getting started with Micrometer and/or OpenTelemetry with WildFly, keep an eye on the WildFly Quickstarts for updates.