Class HibernateQueryMetrics

java.lang.Object
io.micrometer.core.instrument.binder.jpa.HibernateQueryMetrics
All Implemented Interfaces:
MeterBinder

@NonNullApi @NonNullFields @Deprecated public class HibernateQueryMetrics extends Object implements MeterBinder
Deprecated.
This implementation is deprecated in favor of the MeterBinder maintained as part of the Hibernate project as of version 5.4.26. See https://mvnrepository.com/artifact/org.hibernate/hibernate-micrometer/
A MeterBinder implementation that provides Hibernate query metrics. It exposes the same statistics as would be exposed when calling Statistics.getQueryStatistics(String). Note that only SELECT queries are recorded in QueryStatistics.

Be aware of the potential for high cardinality of unique Hibernate queries executed by your application when considering using this MeterBinder.

Since:
1.4.0
  • Constructor Details

    • HibernateQueryMetrics

      public HibernateQueryMetrics(org.hibernate.SessionFactory sessionFactory, String sessionFactoryName, Iterable<Tag> tags)
      Deprecated.
      Create a HibernateQueryMetrics.
      Parameters:
      sessionFactory - session factory to use
      sessionFactoryName - session factory name as a tag value
      tags - additional tags
  • Method Details

    • monitor

      public static void monitor(MeterRegistry registry, org.hibernate.SessionFactory sessionFactory, String sessionFactoryName, String... tags)
      Deprecated.
      Create HibernateQueryMetrics and bind to the specified meter registry.
      Parameters:
      registry - meter registry to use
      sessionFactory - session factory to use
      sessionFactoryName - session factory name as a tag value
      tags - additional tags
    • monitor

      public static void monitor(MeterRegistry registry, org.hibernate.SessionFactory sessionFactory, String sessionFactoryName, Iterable<Tag> tags)
      Deprecated.
      Create HibernateQueryMetrics and bind to the specified meter registry.
      Parameters:
      registry - meter registry to use
      sessionFactory - session factory to use
      sessionFactoryName - session factory name as a tag value
      tags - additional tags
    • bindTo

      public void bindTo(MeterRegistry meterRegistry)
      Deprecated.
      Specified by:
      bindTo in interface MeterBinder