Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you use Docker, see here.

Integration on Linux

The inspectIT can be integrated with in the start up script of Catalina, which is in the location $CATALINA_HOME/bin/catalina.sh. The $CATALINA_HOME represents the root of your Tomcat installation. inspectIT can be easily integrated within this file. A best practice is to define variables holding the references to the inspectIT installation and configuration folders.

Code Block
set INSPECTIT_AGENT_HOME="[path-to-inspectit-agent]"
export INSPECTIT_AGENT_HOME

set INSPECTIT_CONFIG_HOME="$[path-to-config-folder]"
export INSPECTIT_CONFIG_HOME

set INSPECTIT_JAVA_OPTS="-Xbootclasspath/p:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -javaagent:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -Dinspectit.config=${INSPECTIT_CONFIG_HOME}repository=[REPOSIOTRY_IP]:[REPOSITORY_PORT] -Dinspectit.agent.name=[AGENT_DISPLAY_NAME]"
export INSPECTIT_JAVA_OPTS

# integrate inspectit java options with the java options of Tomcat
set JAVA_OPTS="${INSPECTIT_JAVA_OPTS} ${JAVA_OPTS}"

If this approach is not working please try:

Code Block
set JAVA_OPTS=-javaagent:[path-to-inspectit-agent]\inspectit-agent.jar -Dinspectit.config=[path-to-config-folder]

...

 %JAVA_OPTS%
Tip
titleUsing agent only when Tomcat starts

If you alter the catalina.sh script as described above the inspectIT agent will be started with any action (start/stop/etc) you call the script with. It can be very annoying and usually not necessary to use inspectIT agent when Tomcat is stopped for example. To only use inspectIT agent with starting the Tomcat you can use following "hack":

Code Block
if [ "$1" = "start" ]; then
	JAVA_OPTS="$JAVA_OPTS -javaagent:[INSPECTIT_AGENT_HOME]/inspectit-agent.jar -Dinspectit.repository=[REPOSIOTRY_IP]:[REPOSITORY_PORT] -Dinspectit.agent.name=[AGENT_DISPLAY_NAME]"
fi

This has been tested with Tomcat version 7.0.70

 

Integration on Windows

The inspectIT can be integrated without touching the start up script of Catalina. To integrate the inspectIT agent, a new batch-script called 'setenv.bat' has to be created in the $CATALINA_HOME/bin/ directory. The $CATALINA_HOME represents the root of your Tomcat installation. This script will be automatically executed by the default start-scripts of Tomcat. This script is used to pass arguments to Tomcat.

Simply adapt the variables (INSPECTIT_AGENT_HOME, INSPECTIT_CONFIG_HOME) of the following script to match your environment and you're done.

Code Block
titlesetenv.bat
set INSPECTIT_AGENT_HOME=[path-to-inspectit-agent]
set INSPECTIT_CONFIG_HOME=[path-to-config-folder]

set JAVA_OPTS=-javaagent:%INSPECTIT_AGENT_HOME%/inspectit-agent.jar -Dinspectit.repository=[REPOSIOTRY_IP]:[REPOSITORY_PORT] -Dinspectit.agent.name=[AGENT_DISPLAY_NAME]

Known issues

Please see 11927657 question for information about the known problem with instrumentation on JBoss v8Tomcat.