A screenshot of the build file for the MicroProfile OpenTracing quickstart project.

This article builds on my previous tutorial, Enable Eclipse MicroProfile applications on Red Hat JBoss Enterprise Application Platform 7.3. To follow the examples, you must have Eclipse MicroProfile enabled in your Red Hat JBoss Enterprise Application Platform Expansion Pack (JBoss EAP XP) 1.0.0.GA installation, via Red Hat CodeReady Studio. See the previous article for installation instructions.

In this article, we will use the installed MicroProfile-enabled image to set up a JBoss EAP XP quickstart project in Red Hat CodeReady Workspaces (CRW). You can also apply what you learn from this article to develop your own applications using CodeReady Workspaces.

Note: For more examples, be sure to see the video demonstration at the end of the article.

Step 1: Create a new devfile

To start, open CodeReady WorkSpaces and create a new devfile. In the next sections, I'll describe the steps to configure and build this devfile so that you can build and run the quickstarts in CodeReady Workspaces. You can download the sample devfile here.

Step 2: Define the editor plugins

Because this is a Java project, we're using the Java Che plugin:

  type: chePlugin
  id: redhat/java11/latest

Step 3: Define the Jaeger Docker image

This example uses Jaeger for MicroProfile OpenTracing, so we include a Docker image to start a Jaeger server instance and expose its UI endpoint on port 16686:

  alias: jaeger
  type: dockerimage
  image: jaegertracing/all-in-one
  memoryLimit: 128Mi
      - name: 'tracing-ui'
        port: 16686

Note: You can find the full eapxp-quickstarts.yaml file here.

Step 4: Define the JBoss EAP XP component

The last component is the source-to-image (S2I) Docker image for JBoss EAP XP. This image provides instances of both Apache Maven to build the applications and the JBoss EAP XP runtime to run them.

We need to expose the HTTP endpoint to be able to access the running application on port 8080. Later, we'll also need to be able to expose the management endpoint on port 9990, because JBoss EAP XP exposes the MicroProfile Health and MicroProfile Metrics APIs on this endpoint.

We also define the environment variables for this container. These will configure its various elements, as shown:

  type: dockerimage
  alias: maven
  image: 'registry.redhat.io/jboss-eap-7/eap-xp1-openjdk11-openshift-rhel8@sha256:bebc469f8b21d8132f7b0df62b90107e68e7a77c36d39270f349216557102787'
# Enabling Jaeger tracing
     value: 'true'
# Define the Jaeger service name 
     value: 'microprofile-opentracing'
# Configure Jaeger traces
     value: 'true'
     value: 'const'
     value: '1'
    name: MAVEN_OPTS
    value: >-
     -Xmx200m -XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4
     -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/jboss
  memoryLimit: 1024Mi
    name: eap-http
    port: 8080
    name: eap-management
    port: 9990
  mountSources: true
    name: m2
    containerPath: /home/jboss/.m2

First, we set the environment variable WILDFLY_TRACING_ENABLED to true to enable MicroProfile OpenTracing in JBoss EAP XP.

Second, we configure how Microprofile OpenTracing traces are collected and sent to the Jaeger instance using JAEGER_SERVICE_NAME, JAEGER_REPORTER_LOG_SPANS, JAEGER_SAMPLER_TYPE, and JAEGER_SAMPLER_PARAM.

Last, we need to configure Apache Maven using MAVEN_OPTS.

As shown in Figure 1, we provide several commands. The most notable is a build command to build from the Apache Maven pom.xml. (We'll use the copy war command to deploy the application after it's been built.)

A screenshot of the build commands available in the quickstart project workspace.
Figure 1: Build commands for the MicroProfile OpenTracing quickstart project.

Step 5: Build the project

Finally, we select the pom.xml for the microprofile-opentracing quickstart and build the file. Once it is built, you can copy the resulting WAR file. Use the eap-http endpoint command to produce endpoint traces, then use the tracing-ui command to see them in the Jaeger instance, as shown in Figure 2.

A screenshot of the build file for the MicroProfile OpenTracing quickstart project.
Figure 2: Build the MicroProfile OpenTracing quickstart project.

Next steps

You can follow these instructions and the video demonstration at the end of the article to build and install the microprofile-health and microprofile-metrics quickstart projects in your workspace. You would use the eap-management endpoint to access MicroProfile Health content, as shown in Figure 3.

A screenshot of the CRW workspace with the MicroProfile Health endpoint configured.
Figure 3: Database connection for a MicroProfile application health check.

Video demo: See more MicroProfile quickstarts in action

This video demonstrates how to set up CodeReady Workspaces to build and run MicroProfile quickstarts on JBoss EAP XP 1.0. Start the video now to see Eclipse MicroProfile OpenTracing, Eclipse MicroProfile Health, and Eclipse MicroProfile Metrics in action.


In my previous article, I showed you how to install JBoss EAP XP 1.0 and enable Eclipse MicroProfile support on that platform. In this article, I showed you how to configure and run a MicroProfile quickstart project using CodeReady Workspaces. For more details, be sure to check out the video demonstration that is included in both articles.