Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Relic for Spring Boot

Recently, we convert a tomcat/spring app to spring boot. Everything is working fine apart from new relic. Is there a way I can easily config new relic with spring boot project. I don't want to hard code the location of new relic agent jar path, then run the spring boot project with the path.

edit: Spring boot project is with maven

like image 470
jasonfungsing Avatar asked Nov 13 '14 05:11

jasonfungsing


1 Answers

You can include NewRelic Maven dependency and use maven-dependency-plugin to unpack in into your target/classes directory, which allows Maven to include it into final Jar file. Then you have to add Premain-Class attribute into manifest file and you can use your application jar as -javaagent source. You can find details on my blog post

like image 81
Jakub Kubrynski Avatar answered Sep 28 '22 16:09

Jakub Kubrynski