Java Agent for a Tomcat JVM


(O.Y.) #1

Hi,

I'm trying to pass the jar file with a properties file. As I understood that this was possible.
The properties file is in the same folder and named elasticapm.properties.
How can I pass this file at the startup of my Tomcat.

Br,


(Wolfram Hau├čig) #2

Hello,

We use the java agent in version 1.3 and this is what we added to the startup.sh file:

JAVA_OPTS="$JAVA_OPTS -javaagent:/home/tomcat/apm-agent/elastic-apm-agent-1.3.0.jar "
export JAVA_OPTS


(Felix Barnsteiner) #3

Hi and thanks for checking out Elastic APM :slight_smile:

The elasticapm.properties is only for the configuration settings of the agent and does not replace setting the -javaagent argument. See also https://www.elastic.co/guide/en/apm/agent/java/master/configuration.html

You can find tomcat installation instructions here: https://www.elastic.co/guide/en/apm/agent/java/master/setup-javaagent.html#setup-tomcat

Cheers,
Felix


(O.Y.) #4

Hi,
Found out how to pass the configuration file. Used -Delastic.apm.configuration=file: in my tomcat options to make it work.
Thx Felix for the information, But just missed the info about the configuration file


(Felix Barnsteiner) #5

This is not an option I'm aware of. Where did you read about that?

You have to put the elasticapm.properties file in the same directory where the agent jar is in.


(O.Y.) #6

Tomcat configuration files are modified to start our application.
In order to not screw up things I modified it directy in the registry.
Checked out the other startup option where I found that.
The file was in th same directory since the beginning I tested, it has been picked up since I putted this in the startup options.


(Felix Barnsteiner) #7

Do you have a link at hand?


(O.Y.) #8

Sorry Felix, Was talking about the other startup options set in the registry for Tomcat.

I'll try to inform where our R&D found these informations.