Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Hibernate Statistics through Metrics endpoint #2157

Closed
mdeinum opened this issue Dec 15, 2014 · 5 comments
Closed

Expose Hibernate Statistics through Metrics endpoint #2157

mdeinum opened this issue Dec 15, 2014 · 5 comments
Labels
status: duplicate A duplicate of another issue status: superseded An issue that has been superseded by another

Comments

@mdeinum
Copy link
Contributor

mdeinum commented Dec 15, 2014

When using Hibernate as the ORM provider it would be nice that, when statistics are enabled, those would be accessible through a metrics endpoint.

@philwebb philwebb added the type: enhancement A general enhancement label Dec 15, 2014
@kiview
Copy link

kiview commented Mar 27, 2015

How do you enable Hibernate Statistics in Spring-Boot?

@wilkinsona
Copy link
Member

Set spring.jpa.properties.hibernate.generate_statistics to true in application.properties

mdeinum added a commit to mdeinum/spring-boot that referenced this issue Jul 24, 2015
When hibernate is on the classpath and an `EntityManagerFactory` is configured then
register a `HibernateMetrics` bean so that the statistics from hibernate get published
to the metrics endpoint.

The exposed statistics are the same as those that would be exposed using `Statistics.logSummary`
from hibernate itself.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Aug 24, 2015
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Aug 24, 2015
Defensivly catch the PersistenceException when unwrapping.

Issue: spring-projects#2157
@csavory
Copy link
Contributor

csavory commented Dec 10, 2015

@wilkinsona @mdeinum I'm not sure if this would help, but I wrote a subclass of PublicMetrics for our project that exposes some hibernate metrics.

mdeinum added a commit to mdeinum/spring-boot that referenced this issue Apr 24, 2016
When hibernate is on the classpath and an `EntityManagerFactory` is configured then
register a `HibernateMetrics` bean so that the statistics from hibernate get published
to the metrics endpoint.

The exposed statistics are the same as those that would be exposed using `Statistics.logSummary`
from hibernate itself.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Apr 24, 2016
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Apr 24, 2016
Defensivly catch the PersistenceException when unwrapping.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Apr 24, 2016
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Apr 24, 2016
Formatting with tabs instead of spaces and update of
copyright header.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue Apr 24, 2016
@marcushenrique
Copy link

marcushenrique commented Mar 9, 2017

Any news about this? Would appreciate to access hibernate statistics through actuator.

@snicoll
Copy link
Member

snicoll commented Mar 10, 2017

Closing in favour of the PR #3596

@snicoll snicoll closed this as completed Mar 10, 2017
@snicoll snicoll added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Mar 10, 2017
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 17, 2017
When hibernate is on the classpath and an `EntityManagerFactory` is configured then
register a `HibernateMetrics` bean so that the statistics from hibernate get published
to the metrics endpoint.

The exposed statistics are the same as those that would be exposed using `Statistics.logSummary`
from hibernate itself.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 17, 2017
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 17, 2017
Defensivly catch the PersistenceException when unwrapping.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 17, 2017
Formatting with tabs instead of spaces and update of
copyright header.

Issue: spring-projects#2157
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 17, 2017
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 17, 2017
mdeinum added a commit to mdeinum/spring-boot that referenced this issue May 29, 2017
…ot into spring-projectsgh-2157

# Conflicts:
#	spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
@philwebb philwebb added the status: superseded An issue that has been superseded by another label Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

7 participants