Showing results for 
Show  only  | Search instead for 
Did you mean: 

Building a Robust Micrometer Integration



As Dynatrace developers its important to understand how metrics are sent to Dynatrace. Of course utilizing Dynatrace's OneAgent built-in detection is the first step to reaching observability. We also have access to intelligent extensions like Micrometer for building our own defined custom metrics through the Meter interface.


Micrometer Docs

Dynatace Micrometer Docs


If you are familiar with the separate APIs, there are actually multiple methods of metric ingestions between version 1 and version 2 of the API. Correct me if I'm wrong but I believe version 2 came out when the OneAgent was implemented?


I recommend checking out the Dynatrace Meter Registry source code. It provides a lot of interesting insight on how Micrometer sends metrics to the API. For example there are two exporters that correlate to the two API versions. 


Dynatrace Meter Registry code



Taking a look at the Dynatrace Meter Registry Builder object you can see the HttpUrlConnectionSender() method. This is used to configure your organization's proxy server on the registry. This method uses a unique Micrometer interface called HttpSender which enables build REST communication for Micrometer metrics.


Let's take a look...


Here you can see that we a Proxy parameter.


So you'll want to create a Bean method that builds a proxy-based Meter Registry. Furthermore, you'll want to obtain those proxy parameters via property files using the "@Value" parameter annotation.


public DynatraceMeterRegistry myfunction(DynatraceConfig config, @Value("{}")){

            your logic...

            return registry







Reaching Observability Other Graphics_2023-08-13_03-52-55.png


DynaMight Legend
DynaMight Legend

Thanks for sharing this @Nick-Montana 


Featured Posts