Search code examples
spring-bootkotlinnewrelicmicrometerspring-micrometer

How to pass application name for New Relic Insights in Spring boot micrometer


I successfully configured New Relic with micrometer, but I've observed that there is no application name sent along.

I would like to include it in order to be able filter on different environments.


Solution

  • I've managed to retrieve app_name from New Relic using newrelic-api:

    NewRelic.getAgent().config.getValue("app_name")
    

    Having this value I've just passed it to commonTags inside MeterRegistryCustomizer<MeterRegistry>