Follow the steps given below to install Java agent in WildFly servers v8.x & above:
license.key=[LICENSE KEY]
apm.host=http://[HOST]:[PORT]
application.name=[APPLICATION NAME]
where
Example:
license.key=APMI_74447444b666d7ab5174cc3021a9b68dd4b3364d50f99c2969360810313e8fac
apm.host=http://apm-prod-server:9090
application.name=Wildfly_Server
Using Applications Manager's Wildfly monitoring software, agent can be configured based on the following installation types:
set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine -javaagent:<Agent_directory_full_path>\apminsightjavaagent.jar
where <Agent_directory_full_path> refers to the directory where the java agent is extracted.
set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine -javaagent:<Agent_directory_full_path>\apminsight-javaagent.jar
echo ==============================================================================
echo.
echo JBoss Bootstrap Environment
echo.
echo JBOSS_HOME: "%JBOSS_HOME%"
echo.
echo JAVA: "%JAVA%"
echo. echo JAVA_OPTS: "%JAVA_OPTS%"
echo.
echo ==============================================================================
echo.
After adding Java agent and performing a restart of Jboss server, if there are any Logger / Log Manager exceptions in logs, proceed to do the following step:
For JDK 8 & below: Modify the JAVA_OPTS argument set previously in Step 1 as below:
set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine,org.jboss.logmanager -javaagent: <Agent_directory_full_path>\apminsight-javaagent.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:<JBOSS_HOME>/<path_to_jbosslogmanager_jar>/jboss-logmanager-<version>.jar
For JDK 9 & above: Modify the JAVA_OPTS argument set previously in Step 1 as below:
set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine,org.jboss.logmanager -javaagent: <Agent_directory_full_path>\apminsight-javaagent.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:<JBOSS_HOME>/<path_to_jbosslogmanager_jar>/jboss-logmanager-<version>.jar
Note: Make sure to modify the JAR filename and path in <JBOSS_HOME>/<path_to_jboss-logmanager_jar>/jboss-logmanager-<version>.jar to the correct jboss-logmanager JAR as the name and path differ with different versions of JBoss. Learn more
JAVA_OPTS=$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine -javaagent:<Agent_directory_full_path>\apminsightjavaagent.jar
where <Agent_directory_full_path> refers to the directory where the java agent is extracted.
JAVA_OPTS=$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine -javaagent:<Agent_directory_full_path>\apminsight-javaagent.jar
echo "=============================================================================="
echo ""
echo "JBoss Bootstrap Environment"
echo ""
echo "JBOSS_HOME: %JBOSS_HOME%"
echo ""
echo "JAVA: %JAVA%"
echo "" echo "JAVA_OPTS: %JAVA_OPTS%"
echo ""
echo "=============================================================================="
echo ""
After adding Java agent and performing a restart of Jboss server, if there are any Logger/Log Manager exceptions in logs, perform the following step:
For JDK 8 & below: Modify the JAVA_OPTS argument set previously in Step 1 as below:
JAVA_OPTS=$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine,org.jboss.logmanager -javaagent: <Agent_directory_full_path>\apminsight-javaagent.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:<JBOSS_HOME>/<path_to_jbosslogmanager_jar>/jboss-logmanager-<version>.jar
For JDK 9 & above: Modify the JAVA_OPTS argument set previously in Step 1 as below:
JAVA_OPTS=$JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine,org.jboss.logmanager -javaagent: <Agent_directory_full_path>\apminsight-javaagent.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:<JBOSS_HOME>/<path_to_jbosslogmanager_jar>/jboss-logmanager-<version>.jar
Note: Make sure to modify the JAR filename and path in <JBOSS_HOME>/<path_to_jboss-logmanager_jar>/jboss-logmanager-<version>.jar to the correct jboss-logmanager JAR as the name and path differ with different versions of JBoss. Learn more
For domain based installation, the installation may vary depends on the environment of the Wildfly Server through any of the following methods:
Note: You can also add the configuration settings to both domain.xml and host.xml depending upon the global configuration and the host-specific configuration.
<server-groups>
<server-group name="main-servergroup" profile="full">
<jvm name="default">
<heap size="64m" max-size="512m" />
</jvm>
<jvm name="insight">
<jvm-options>
<option value="-javaagent: <agent_directory_full_path>/apminsight-javaagent.jar" />
</jvm-options>
</jvm>
<socket-binding-group ref="full-sockets" />
</server-group> <server-group name="other-server-group" profile="fullha">
<jvm name="default">
<heap size="64m" max-size="512m" />
</jvm>
<socket-binding-group ref="full-ha-sockets" />
</server-group>
</server-groups>
<system-properties>
<property name="java.net.preferIPv4Stack" value="true"/>
<property name="jboss.modules.system.pkgs" value="org.jboss.byteman,com.manageengine" boot-time="true"/>
</system-properties>
Note: Changes in the domain.xml file require complete restart of both management host and the server host to take full effect.
<servers>
<server name="server-one" group="main-server-group"/>
<server name="server-two" group="main-servergroup" auto-start="true">
<jvm name="default"/>
<jvm name="insight">
<jvm-options>
<option value="-javaagent: <agent_directory_full_path>/apminsight-javaagent.jar" />
</jvm-options>
</jvm>
<socket-bindings port-offset="150"/>
</server>
<server name="server-three" group="other-servergroup" auto-start="false">
<jvm name="default"/>
<socket-bindings port-offset="250"/>
</server>
</servers>
<system-properties>
<property name="java.net.preferIPv4Stack" value="true"/>
<property name="jboss.modules.system.pkgs" value="org.jboss.byteman,com.manageengine" boot-time="true"/>
</system-properties>
Note: Changes in the host.xml file require complete restart of both management host and the server host to take full effect.