Command-line options to enabling Application Performance Monitoring for Tomcat

This post will go over the specifics of running the command-line options for enabling the Java Application Performance Monitoring (APM) agent with a Tomcat server.  This is not coverage of the full System Center Operations Manager (SCOM) setup (please refer to the documentation), rather the details about how to enable the Java APM agent. Of course, it should be mentioned that it is assumed prior to starting you have obtained the ZIP file APM-Java-Agent-*.zip (which can be obtained via a Task in SCOM Console for the application server provided by the the Java APM Management Packs).

In order to get APM data, the java process needs to be started with some additional command-line arguments to inform it that a monitoring agent in available.  As per the documentation in java.lang.instrument, the java process needs to start with the additional command-line argument -javaagent.  

For Window, the suggested modifications to the catalina.bat script would look like:


set APM_DIR=\path\to\apm\agent\zip\contents
set APM_OPTS=-Djava.library.path="%APM_DIR%" -javaagent:"%APM_DIR%\apm_facade.jar" -Xbootclasspath/p:"%APM_DIR%\apm_facade.jar" -Xbootclasspath/p:"%APM_DIR%\apm_producers.jar"

rem ----- Execute The Requested Command ---------------------------------------


For Linux, the suggested modifications to the script would look like:

if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"

APM_OPTS="-javaagent:$APM_DIR/apm_facade.jar -Xbootclasspath/p:$APM_DIR/apm_producers.jar -Xbootclasspath/p:$APM_DIR/apm_facade.jar"

# ----- Execute The Requested Command -----------------------------------------


Comments (4)

  1. Anonymous says:

    Great job

  2. Anonymous says:

    Thanks, I'll be sure to share this with the team.

  3. Anonymous says:

    I previously mentioned that Application Insights supports Java and this post is a follow-up with some

  4. Anonymous says:

    This post will highlight a quickstart guide to getting-up and running with the Visual Studio Online Application