Skip to content

Micrometer new relic correct dependency is "difficult"/"wrong" to use. #29908

Closed
@mshukry11

Description

@mshukry11

Currently there are 2 implementations for micrometer new relic:

  1. io.micrometer:micrometer-registry-new-relic
  2. 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:

  1. Add the 2nd implementation, using implementation.
  2. Create a new NewrelicProperties class which will not have any dependency on the 1st implementation (e.g. without ClientProviderType)
  3. Create config classes/beans for the 2nd implementation of Newrelic. e.g. https://github.com/newrelic/micrometer-registry-newrelic/wiki/Spring-Config-Example .
  4. Disable the existing implementation: management.metrics.export.newrelic.enabled: false
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions