Integrate Spring Boot Actuator with New Relic

I am trying to integrate New Relic with Spring Boot actuator. Most of the tutorials and response in StackOverflow itself suggest to use New Relic Java Agent but as per Spring Boot documentation installing Java Agent is not mandatory (unless I misunderstood something) also checked this. So, here is my application.properties currently.

    management.metrics.export.newrelic.enabled = true
    management.metrics.export.newrelic.api-key = <API_KEY>
    management.metrics.export.newrelic.account-id = <ACCOUNT_ID>
    logging.level.io.micrometer.newrelic=TRACE
    management.metrics.export.newrelic.step=30s

and in the log I am seeing

2021-01-11 12:05:18.315 DEBUG 44635 --- [trics-publisher] i.m.n.NewRelicInsightsApiClientProvider  : successfully sent 73 metrics to New Relic.

Based on this logs it looks like it is sending logs. But I have no idea where to see this logs. Ideally I would like to pass app name as well so that I can differentiate metric by app name and preferably by env as well later. Any suggestions?

Hi @NPoudyal, Sorry you have been waiting awhile for a response from our community.

I’m going to bring this back to the attention of our support team. Thanks for your patience!

Neal Mc

any updates on this. I am also facing similar issue

ok I was able to solve the problem I am posting my solution so that other could benefit from it. When you are using Spring Boot actuator it pushes metric as a event type “SpringBootSample”. If you use NRQL you can confirm this.

FROM SpringBootSample SELECT max(value) TIMESERIES 1 minute WHERE metricName = 'jvmMemoryCommitted'

So, all I had to do was add this in application.properties

management.metrics.export.newrelic.event-type = LoanApplication

Now on to next problem how to write query to pull these data.

2 Likes