New Relic for Spring Boot

大城市里の小女人 提交于 2019-12-05 03:42:24

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

Step by step instructions

  • Extract the files from the newrelic java agent archive.
  • Create a directory named newrelic in the root of your application.
  • Place the newrelic.jar from the archive in the above created newrelic folder
  • Place the newrelic.yml YAML config file in the above created newrelic folder.
  • Update the values in newrelic.yml as below.
    • license_key: 'your license key'
    • app_name: ‘Your application name’
  • Run you application by using the option javaagent
    • java -javaagent:newrelic\newrelic.jar -jar yourapplication.jar

-javaagent option needs to be before the -jar so the agent can start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!