Demo application to integrate New Relic with Spring Boot using micrometer
- Add this dependency
<dependency>
<groupId>com.newrelic.telemetry</groupId>
<artifactId>micrometer-registry-new-relic</artifactId>
<version>0.7.0</version>
</dependency>
- Modify the MicrometerConfig.java class to add your API Key and Application name.
- Run the application.
- Log in to your New Relic account.
- Go to Explorer Tab.
- Click on Services-OpenTelemetry
- You can see the name of your application(which you had mentioned in the MicrometerConfig file) listed there.
- Click on the application name.
- The dashboard should look somethin like this.
- Download the Java Agent from this URL- https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/
- Extract it.
- Modify the newrelic.yml file inside the extracted folder to inlcude your license_key: app_name:
- Create a SpringBoot application with some REST endpoints.
- Build the application.
- Navigate to the root path where you have extracted the newrelic java agent.
- Enter this command
java -javagent:<path to your new relic jar>\newrelic.jar -jar <path to your application jar>\<you rapplication jar name>.jar
- Log in to your New Relic account.
- Go to Explorer Tab.
- Click on Services-APM
- You can see the name of your application(which you had mentioned in the newrelic.yml file) listed there.
- Click on the application name.
- The dashboard should look somethin like this.