Micrometer: [Spring-Boot] Upgrading from 1.5.9 to 2.0.0.M7 doesn't provide the same metrics

Created on 30 Nov 2017  路  4Comments  路  Source: micrometer-metrics/micrometer

This is more a question than a bug report, as I'm not sure it's not a PEBKAC..

I have an application in Spring-Boot 1.5.7 which I wanted to upgrade to 2.0.0.M7. But I saw that the metrics in actuator changed a lot (not a bad thing) but most importantly, 2 of them disappeared:

  • cache.*
  • httpsessions.*

I manage to reproduce this with https://github.com/alecharp/problem-actuator-upgrade. There are 2 tags on the repository:

  • 1.5.9 reproduce the "it's working" case where you have behind http://localhost:8080/metrics the two entries which I need (cache and httpsessions)
  • 2.0.0.M7 reproduce the "it's not working" case where the two entries have disappeared from http://localhost:8080/actuator/metrics.

I tried to have an as-simple-as-possible repository, only using caffeine dependency to act as the cache.

Thanks in advance for your help.

Most helpful comment

The httpsessions.* metrics are provided in Boot 1.5 by TomcatPublicMetrics. That class was removed as part of the Micrometer migration, and I'm not aware of a replacement. There isn't one in Boot itself and I don't think Micrometer has one either.

All 4 comments

The httpsessions.* metrics are provided in Boot 1.5 by TomcatPublicMetrics. That class was removed as part of the Micrometer migration, and I'm not aware of a replacement. There isn't one in Boot itself and I don't think Micrometer has one either.

thanks @wilkinsona for the quick reply. it seems that the cache.* was missing its auto-configuration as @snicoll pointed. Any chance to have the TomcatPublicMetrics ported to here?

@alecharp and @wilkinsona I created #257 to create the TomcatPublicMetrics equivalent.

Thanks! I think we can close this, as everything I reported is now track on their own tickets.

References:

  • one missing auto-configuration in spring-boot project (https://github.com/spring-projects/spring-boot/issues/11221)
  • one missing metric in micrometer (#257)
Was this page helpful?
0 / 5 - 0 ratings