I was doing some research on how to expose Hibernate metrics via Prometheus via Spring Boot Actuator, but I was struggling to find out how to do that.
I added the following property to my Spring Boot: Application:spring.jpa.properties.hibernate.generate_statistics=true
But all that did was add logging from Hibernate. I found these two PRs from the Spring Boot project:
- https://github.com/spring-projects/spring-boot/pull/3596
- https://github.com/spring-projects/spring-boot/issues/2157
but it looks like publishing Hibernate metrics via Spring Boot Actuator never made it in because of Micrometer adoption.
Is there a way to expose the metrics that the Hibernate EntityManagerFactory collects via Spring Boot Actuator?