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

Building a Robust Micrometer Integration

Nick-Montana
Contributor

Hi,

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

NickMontana_0-1691899844584.png

 

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...

NickMontana_0-1692031263741.png

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.

@Bean

public DynatraceMeterRegistry myfunction(DynatraceConfig config, @Value("{com.foo.barr.dynatrace.proxy}")){

            your logic...

            return registry

}

 

 

 

 

 

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

1 REPLY 1

ChadTurner
DynaMight Legend
DynaMight Legend

Thanks for sharing this @Nick-Montana 

-Chad

Featured Posts