Coming Up for Air

WildFly, Micrometer, and OpenTelemetry

Monday, 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:

Micrometer
 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
OpenTelemetry
 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 otel.sdk.disabled=false to one of your MicroProfile Config sources.

If you want more information on getting started with Micrometer and/or OpenTelemetry with WildFly, keep an eye on the WildFly Quickstarts for updates.

Search

    Quotes

    Sample quote

    Quote source

    About

    My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

    I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

    On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

    My Links

    Publications