- Ya
- 21 Agosti 2026, 02:07 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 1d364c0
/actuator/prometheus already carried jdbc_* and hikaricp_* but no hibernate_*, because Spring Boot 3 only auto-configures those metrics when **************** is on the classpath. Added, plus hibernate.generate_statistics. The reason is concrete. Auditing this service for N+1 queries had to be done by grepping for association navigations, and that method is wrong in both directions: it over-counts, because an association name like 'vendor' or 'user' is lazy on some entities and eager on others (9 of 67 reported sites turned out to be eager and needed nothing), and it under-counts badly, because it sees .getX().getY() but not iteration over a lazy collection — which is most of the real surface. hibernate_statements_total answers the same question by measurement. An endpoint issuing 200 statements per call is visible whatever shape the code takes, and open-in-view being on means every one of those lazy loads is otherwise silent. Costs a few percent. Worth it in a service where the last audit found four separate O(rows) endpoints.