Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mshukry11 opened this issue Feb 18, 2022 · 5 comments
Closed
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@mshukry11
Copy link

mshukry11 commented Feb 18, 2022

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
@mshukry11 mshukry11 changed the title Micrometer new relic correct dependency is "difficult" to use. Micrometer new relic correct dependency is "difficult"/"wrong" to use. Feb 18, 2022
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 18, 2022
@wilkinsona
Copy link
Member

Thanks for the report. Unfortunately I'm a bit confused by the steps that you have described. If you want to use com.newrelic.telemetrymicrometer-registry-new-relic with Spring Boot, there should be any need to compile Spring Boot's code. The only step that should be necessary is to define your own NewRelicRegistry bean that's configured to meet your needs. Can you please clarify?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Feb 18, 2022
@mshukry11
Copy link
Author

mshukry11 commented Feb 18, 2022

@wilkinsona you are correct about that part, I apologize.
Updated the description accordingly.

Note I also added what are the most "painful" parts for me, which is using a different prefix.

We work with multiple applications, some which still uses the "old" versions where spring boot configuration doesn't strictly depends on the 1st implementation.

For our infrastructure we have config for management.metrics.export.newrelic prefix. Not in any specific app, but for all of them.

So now for newer apps that wants to both use new spring version and the "correct" implementation, we need to use a different prefix, on the infrastructure as well.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 18, 2022
@wilkinsona
Copy link
Member

Thanks for the clarification. While I believe the plan is for Micrometer's NewRelic registry to be replaced by NewRelic's own that isn't a straightforward transition. Until such a time as NewRelic's implementation is, functionality wise, a drop-in replacement and Micrometer's implementation is then deprecated, I don't think we can do anything here. Spring Boot supporting both would not achieve what you want as the two have different configuration options so Boot would end up with different property prefixes.

@shakuzen please let me know if I've missed anything here or things have moved on since the discussion in newrelic/micrometer-registry-newrelic#46.

@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Feb 18, 2022
@shakuzen
Copy link
Member

Since that discussion, New Relic Insights (the API/system used by the implementation in the Micrometer repo) has been deprecated (see micrometer-metrics/micrometer#3033), which hopefully means the transition from Insights has been made as smooth as possible by now on the New Relic side and us deprecating the registry in Micrometer does not cause too much disruption for users. We'd like to get feedback from users about anything we can do in Micrometer to help switching. Spring Boot users can follow micrometer-metrics/micrometer#3033 for updates on the registry in the Micrometer repository and provide that feedback.

@wilkinsona
Copy link
Member

wilkinsona commented Feb 22, 2022

Thanks, @shakuzen. I've subscribed to micrometer-metrics/micrometer#3033.

If necessary, we can re-open this issue or open a new issue once the direction for the New Relic registry is finalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

4 participants