简体   繁体   中英

Spring Boot with New Relic without modifying dependencies

I am trying to configure New Relic to monitor Spring applications created using Spring Boot. The applications are already in a released state and I would like to be able to integrate New Relic without modifying the dependencies of the java applications, as in this question .

Is there any way to include the new relic agent in such a way that restarting the Spring Boot application with new command line arguments will suffice?

EDIT

I had read warnings about using the -javaagent:/path/to/newrelic.jar flag and getting error messages, but had not tried it for myself. It appears that this option works now.

SECOND EDIT

The single spring boot app is reporting two separate applications, one for the Embedded Tomcat server and another for the Java application itself. Would there be a way to resolve this?

THIRD EDIT (for anyone reading this in the future)

My spring boot app was reporting two applications to the New Replic APM tool. In order to avoid this, I now start the java application with an environment variable:

export NEW_RELIC_APP_NAME="my spring boot app"
java -jar spring-boot-app-1.0.jar -javaagent:/path/to/newrelic.jar

事实证明,独立应用程序的说明也适用于Spring Boot应用程序:

java -jar spring-boot-app-1.0.jar -javaagent:/path/to/newrelic.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM