Skip to main content

JBoss / WildFly

This guide explains how to instrument a Java application running on JBoss / WildFly by selecting a Linux agent or Windows agent for trace ingestion.

Prerequisites

  • The Motadata Agent must be installed and running on the server where the JBoss/WildFly-based application is deployed. Also, the otelcol should be running as part of the Motadata Agent.
    To check the agent status, open a Linux terminal and run:
service motadata-agent status
  • Java Version must be 8 or higher. To check the version:
java -version
  • The JBoss/WildFly installation directory (i.e., JBOSS_HOME / WILDFLY_HOME) is available.
  • Required permissions to edit server startup configuration and restart JBoss/WildFly.
  • Application should be running on JBoss / WildFly (standalone mode supported via startup scripts).

Configuration Steps

Step1: Register the Application Service in Motadata AIOps

Go to Menu > Settings > APM > Application Registration. Clicking the Application Registration button, you can register a new application.

From the application registration screen, select the instrumentation type Host/VM or Docker.

Java Trace Configuration

FieldDescription
Select AgentSelect the Host/VM where this application is running. You can configure Java application service for both Windows and Linux type agent.
Select LanguageSelect Java from the language icons.
Service NameProvide a unique and meaningful name (for example, jbossservice).
Application PathSpecify the executable/startup path used to start the service (as applicable in your environment).

Providing these details displays Setup Command to instrument your Java application.

Step2: Configure JBoss / WildFly for Instrumentation

JBoss/WildFly instrumentation is done by updating the server startup configuration so the Motadata Java Agent loads on every restart.

Locate standalone.conf

This file controls Java startup options.

  • For JBoss: <JBOSS_HOME>/bin/standalone.conf

  • For WildFly: <WILDFLY_HOME>/bin/standalone.conf

Stop JBoss / WildFly

Use your standard operational stop method. If you start it using the standalone script, stop the process accordingly.

Modify standalone.conf

Navigate to the bin directory and open the file:

cd <JBOSS_HOME>/bin
vi standalone.conf

Or for WildFly:

cd <WILDFLY_HOME>/bin
vi standalone.conf

Add the following lines at the end of the file (or near the JAVA_OPTS definition):

JAVA_OPTS="$JAVA_OPTS \
-javaagent:/motadata/motadata/instrumentation/agents/java/motadata-javaagent.jar \
-Dotel.javaagent.configuration-file=/motadata/motadata/config/<ServiceName>.properties"

Replace the <ServiceName> with the exact service name you registered in Motadata AIOps.

Start / Restart JBoss / WildFly

Start the server using the standard script:

<JBOSS_HOME>/bin/standalone.sh

Or for WildFly:

<WILDFLY_HOME>/bin/standalone.sh

Step3: Configure Attributes and Parameters

After configuring the application, you can provide the below details:

FieldDescription
Service Attributes(Tags)Add key–value tags to your application for better filtering and organizing data in Explorer. Attribute keys must be in lowercase (for example, apm.env = prod). To add multiple Key-Value pairs you can click the add icon.
Add Custom ParametersAllows you to define custom sampling or tagging parameters for advanced use cases. These optional parameters are passed to the agent (for example, version=4).

Clicking the Apply Configuration button, the ingestion gets started.

Once the Application is Running, you need to verify the below points:

  • Confirm that the service has been registered successfully.
  • On the service registration screen, the Service Trace Collection Status should display "Running."
  • The traces will start appearing in the APM Explorer screen.