<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Building a Robust Micrometer Integration in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/Building-a-Robust-Micrometer-Integration/m-p/222497#M1028</link>
    <description>&lt;P&gt;Thanks for sharing this&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/48870"&gt;@Nick-Montana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 12:39:20 GMT</pubDate>
    <dc:creator>ChadTurner</dc:creator>
    <dc:date>2023-09-07T12:39:20Z</dc:date>
    <item>
      <title>Building a Robust Micrometer Integration</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Building-a-Robust-Micrometer-Integration/m-p/220528#M1027</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Micrometer Docs" href="https://micrometer.io/docs/concepts" target="_self"&gt;Micrometer Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="Dynatrace Micrometer Docs" href="https://www.dynatrace.com/support/help/extend-dynatrace/extend-metrics/ingestion-methods/micrometer" target="_self"&gt;Dynatace Micrometer Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/micrometer-metrics/micrometer/blob/main/implementations/micrometer-registry-dynatrace/src/main/java/io/micrometer/dynatrace/DynatraceMeterRegistry.java" target="_self"&gt;Dynatrace Meter Registry code&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NickMontana_0-1691899844584.png" style="width: 637px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13549i4DD3308558078567/image-dimensions/637x355?v=v2" width="637" height="355" role="button" title="NickMontana_0-1691899844584.png" alt="NickMontana_0-1691899844584.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Taking a look at the Dynatrace Meter Registry Builder object you can see the &lt;A href="https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/ipc/http/HttpUrlConnectionSender.java" target="_self"&gt;HttpUrlConnectionSender() method.&lt;/A&gt; This is used to configure your organization's proxy server on the registry. This method uses a unique Micrometer interface called &lt;A href="https://www.javadoc.io/doc/io.micrometer/micrometer-core/1.1.0/io/micrometer/core/ipc/http/HttpSender.Request.html" target="_self"&gt;HttpSender which enables build REST&lt;/A&gt;&amp;nbsp;communication for Micrometer metrics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's take a look...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NickMontana_0-1692031263741.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13569i8965382A45505E19/image-size/large?v=v2&amp;amp;px=999" role="button" title="NickMontana_0-1692031263741.png" alt="NickMontana_0-1692031263741.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here you can see that we a&amp;nbsp;&lt;A href="https://docs.oracle.com/javase/8/docs/api/java/net/Proxy.html" target="_self"&gt;Proxy parameter.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;@Bean&lt;/P&gt;
&lt;P&gt;public DynatraceMeterRegistry myfunction(DynatraceConfig config, @Value("{com.foo.barr.dynatrace.proxy}")){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; your logic...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return registry&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Reaching Observability Other Graphics_2023-08-13_03-52-55.png" style="width: 720px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13548iABDB6B2F23771ABF/image-dimensions/720x471?v=v2" width="720" height="471" role="button" title="Reaching Observability Other Graphics_2023-08-13_03-52-55.png" alt="Reaching Observability Other Graphics_2023-08-13_03-52-55.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 06:41:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Building-a-Robust-Micrometer-Integration/m-p/220528#M1027</guid>
      <dc:creator>Nick-Montana</dc:creator>
      <dc:date>2023-09-08T06:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Building a Robust Micrometer Integration</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Building-a-Robust-Micrometer-Integration/m-p/222497#M1028</link>
      <description>&lt;P&gt;Thanks for sharing this&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/48870"&gt;@Nick-Montana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 12:39:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Building-a-Robust-Micrometer-Integration/m-p/222497#M1028</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-09-07T12:39:20Z</dc:date>
    </item>
  </channel>
</rss>

