Introduction

This tutorial provides a step-by-step guide on installing NewRelic APM on Jboss EAP 7 in standalone mode

Download NewRelic

Download the current new relic APM from the website, or using the next powershell command:

Invoke-WebRequest -Uri https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip -OutFile newrelic-java.zip

Configuring Jboss

Create a folder named lib in JBOSS_HOME folder, and a new folder named endorsed in the lib folder.

In case you are wondering, the JBOSS_HOME is the folder that has Jboss installed, and the folder with the bin/docs/etc folders.

0-jboss-folder

Next, edit the JBOSS_HOME\bin\standalone.conf.bat and add the next lines after the set "JAVA_OPTS=... lines, like bellow:

set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed

set "JAVA_OPTS=-javaagent:%JBOSS_HOME%/lib/endorsed/newrelic/newrelic.jar %JAVA_OPTS%"

For example see here:

1-jboss-config-for-new-relic

Configuring NewRelic

Copy all files from the newrelic-java.zip in the folder JBOSS_HOME\lib\endorsed .

Edit newrelic.yml and add change the license and other settings that you may need.

Putting all to the test

Now we can start jboss using standalone.bat from JBOSS_HOME\bin folder.

If everything is ok, jboss will load the new relic agent jar and read the configuration and write the newrelic log file (named newrelic_agent.log)

2-jboss-new-relic-startup

For more informations about and/or errors you should check the newrelic_agent.log file,

If everything is ok, the local logs should look like :

3-newrelic-log-success

And the Jboss logs should be visible in NewRelic logs tab:

4-newrelic-logs

Also, the application should appear in the APM & Services tab:

5-newrelic-dashboard