Description
Currently there are 2 implementations for micrometer new relic:
io.micrometer:micrometer-registry-new-relic
com.newrelic.telemetrymicrometer-registry-new-relic
According to the repo of the 2nd implementation site (which is by newrelic): https://github.com/newrelic/micrometer-registry-newrelic, that is the version one should use, as it will supersede the 1st implementation
Note: the micrometer project currently includes a NewRelicMeterRegistry that writes metrics to NewRelic as custom events. This implementation is intended to supersede that, as [dimensional metrics](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/new-relic-data-types#dimensional-metrics) are a better fit for micrometer metrics than custom [events](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/new-relic-data-types#events-new-relic).
However currently spring uses the 1st implementation.
If one wants to use spring boot (specifically actuator autoconfigur) together with the 2nd (and "correct") implementation of newrelic, they have to:
- Add the 2nd implementation, using
implementation
. - Create a new NewrelicProperties class which will not have any dependency on the 1st implementation (e.g. without
ClientProviderType
) - Create config classes/beans for the 2nd implementation of Newrelic. e.g. https://github.com/newrelic/micrometer-registry-newrelic/wiki/Spring-Config-Example .
- Disable the existing implementation:
management.metrics.export.newrelic.enabled: false
- Use a different prefix for your own configuration and enable it, e.g.
management.metrics.export.newrelic2.enabled: true
, together with@ConditionalOnExpression("${management.metrics.export.newrelic2.enabled:false}")
on the config class you created in step 3