The best way to send Open Telemetry metrics using Micrometer and send them to New Relic
November 29, 2023
Lately, I was tasked with transmitting Micrometer metrics via Open Telemetry and forwarding them to New Relic for analysis and monitoring.
I noticed that New Relic posted a recipe on how to do that using Open Telemetry SDK and Micrometer Shim, but I wondered if there is a better option.
It turns out there is! I was able to use a dedicated OTLP Registry provided by Micrometer.
The registry requires single dependency:
In my Spring Boot application I was able to define everything in the configuration with no need of manual bean registration:
api-key : <insert your licence here>
service.name: <insert your service name>
By using dedicated Micrometer registry in Spring Boot, I was able to minimize configuration, and use less dependencies. I even created a commit showing how OTLP registry can be used in NR. I cannot create a pull request hence repository is archived, unfortunately.