Description
Upgrading from spring-boot 2.3.4 to 2.5(.4) removed all the jvm, and other metrics from /actuator/metrics only leaving hikari/tomcat.
This is a similar issue to #26630 blaming spring-boot-starter-data-jpa.
This could be the case, however if spring-boot-starter-security is additionally added to the project with adding @EnableWebSecurity (and an empty WebSecurityConfigurer) the jvm metrics are back.
Behaviour is the same also in the latest 2.5.13 version.
## Question/Bug: How do I get the jvm- metrics working with spring-boot-starter-data-jpa (if it is still a contributing factor) and without spring-boot-starter-security?
Comment From: wilkinsona
This sounds like it could be due to some eager initialization (as was the case with #26630) but I can't say for certain without knowing more about the problem. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: Darkvater
Give me a bit of time. Created a skeleton project, and of course it is working in all scenarios (2.5.4 with spring-data-jpa, with spring-data-jpa, spring-security, and without either) so this is annoying. Now I have to start trimming down the real-life project to find out where the issue actually lies... back in a day or two
Comment From: Darkvater
I am sad/happy to report that the fact the metrics are gone is due to some oracle-aq queue functionality we are using. It's something crap built internally and it's impossible to puzzle out exactly which insane configuration there causes this issue. Good for spring-boot, it is working otherwise :)
Comment From: wilkinsona
Thanks for letting us know.