APM Agent not work

Hello Elastic Team:
We have implemented Java Agent with our springboot applicatiions
Springboot : 1.5.10
Java: 1.8.0_161
APM Server : 6.3
APM Agent : 0.6
I place my envset.sh in this path : /home/pengx/APM/apm-agent-0.6.0,
the file is as follows:
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/home/pengx/APM/apm-agent-0.6.0/elastic-apm-agent-0.6.0.jar"

I palce my elasticapm.properties in the same directory the agent jar resides in :
The configuration file is as follows:

-Delastic.apm.service_name=springboot-properties-service
-Delastic.apm.application_packages=com.yiz
-Delastic.apm.server_url=http://localhost:8200
-Delastic.apm.logging.log_level=DEBUG
-Delastic.apm.active=true
-Delastic.apm.logging.log_file=/home/pengx/APM/apm-agent-0.6.0/apm-agent.log

We start the application and then we are getting the below warn in our logs:

2018-08-22 16:30:04.153 [main] WARN co.elastic.apm.impl.ElasticApmTracerBuilder - Missing required value for configuration option service_name
2018-08-22 16:30:04.916 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 0.6.0 on Java 1.8.0_161 (Oracle Corporation) Linux 4.15.0-32-generic

image

Hi Terry, thanks for trying out Elastic APM!

Please try changing the contents of your elasticapm.properties file to the following:

elastic.apm.service_name=springboot-properties-service
elastic.apm.application_packages=com.yiz
elastic.apm.server_url=http://localhost:8200
elastic.apm.logging.log_level=DEBUG
elastic.apm.active=true
elastic.apm.logging.log_file=/home/pengx/APM/apm-agent-0.6.0/apm-agent.log

The -D prefix is only required when passing properties to the JVM via the command line.

Cheers,
Andrew

Hi Andrew:
Thanks for your reply ,I change the contents of my elasticapm.properties as you suggested,now the file is as follows:
image
then,I start my application and also getting the same warn info in our logs:


and other suggestion?

Best wishes!

Sorry, according to the configuraton documentation:

You can place a elasticapm.properties in the same directory the agent jar resides in. No prefix is required for the configuration keys.

I missed that last sentence before. Change the file contents so the keys don't have the "elastic.apm." prefix, i.e.

service_name=springboot-properties-service
application_packages=com.yiz
server_url=http://localhost:8200
logging.log_level=DEBUG
active=true
logging.log_file=/home/pengx/APM/apm-agent-0.6.0/apm-agent.log

Hope that helps.

Wow! The problem has been solved!
Change the file contents so the keys don't have the "elastic.apm." prefix, i.e is right!

Cheers!

I have just updated the documentation and tried to be more clear there. Btw, there is already a newer verison, 0.6.2, which contains some important bug fixes.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.