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

Spring Boot metrics in Dynatrace

BenoitSigouin
Visitor

Hi, I want to see specific metrics in Dynatrace from Spring Boot app. 

For example:

  • stats about the HTTP connector of the embdede tomcat
  • stats about the Hikari connection pool 

So I read that there is something that can be done with Micrometer.

What's really unclear to me is why I would want to use Micrometer at all if my metrics are already exposed through Spring metrics?

6 REPLIES 6

Mizső
DynaMight Leader
DynaMight Leader

Hi @BenoitSigouin,

Maybe you should try to collect them via jmx. For hikari it should work.

Mizs_0-1681489346577.png

Mizs_1-1681489418545.png

Available hikari metrics in this system:

ActiveConnections
ConnectionTimeout
IdleConnections
IdleTimeout
LeakDetectionThreshold
MaximumPoolSize
MaxLifetime
MinimumIdle
ThreadsAwaitingConnection
TotalConnections
ValidationTimeout

Mizs_2-1681489567488.png

I hope it helps.

Best regards,

Mizső

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

Collecting the metrics using JMX has two caveats:

  • MBeans might not be exposed depending on the configuration
  • You need to create an JMX extension for that and always adapt it to application changes. This is a cat and mouse problem.

On the other way - Micrometer metric ingest will allow the application to send metrics directly with already proper dimensions and context to Dynatrace with zero configuration.  

I prefer the approach when application sends the metrics. Applications are aware of the metrics they have and should send them without needing to configure the metrics collection in Dynatrace (or any other monitoring tool).

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

So we have to do so with micrometer ? ever since spring boot use out of the box metrics within on oh its own module (spring metrics) ?

 

@BenoitSigouin SpringBoot2 and SpringBoot3 use SpringBoot Actuator which uses Micrometer and it can be used directly with the Dynatrace Micrometer integration. So if you have SpringBoot>2.6 you just include the dependency (dynatrace micrometer registry) to get the metrics automatically out from SpringBoot actuator. If you have your own application metrics in your Spring Boot application, you should have them exposed using Micrometer API anyway.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Mizső
DynaMight Leader
DynaMight Leader

Hi @Julius_Loman,

What is the DDU consumption of this solution? Can be deducted it form the included 1000 metrics per full stack host in case of OA ingestion?

Thanks in advance.

Mizső

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

 

@Mizső it's just as another ingested metric. Yes, it counts towards the 1000 metrics per full stack host unit. It really depends on the application being monitored. Sure it might cost some DDUs, but the automation is really worth it. The only drawback I see is the fact, that such ingested metrics are not yet automatically displayed on the process group screens.

With the upcoming unified analysis screens for services, I can see big potential when using the metrics with Davis Causal Correlation Analysis. 

 

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts