Class HibernateMetricsBinder

java.lang.Object
io.micronaut.configuration.hibernate.jpa.metrics.HibernateMetricsBinder
All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<jakarta.persistence.EntityManagerFactory>, EventListener

@Singleton @RequiresMetrics @Requires(property="micronaut.metrics.binders.hibernate.enabled",value="true",defaultValue="true") @Requires(classes=org.hibernate.stat.HibernateMetrics.class) public class HibernateMetricsBinder extends Object implements io.micronaut.context.event.BeanCreatedEventListener<jakarta.persistence.EntityManagerFactory>
Binds metrics for Micrometer for each configured EntityManagerFactory.
Since:
1.0
Author:
graemerocher
  • Field Details

  • Constructor Details

    • HibernateMetricsBinder

      public HibernateMetricsBinder(io.micronaut.context.BeanProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistryProvider, @Property(name="micronaut.metrics.binders.hibernate.tags") @MapFormat(transformation=FLAT) Map<String,String> tags)
      Default constructor.
      Parameters:
      meterRegistryProvider - The meter registry provider
      tags - The tags
  • Method Details

    • onCreated

      public jakarta.persistence.EntityManagerFactory onCreated(io.micronaut.context.event.BeanCreatedEvent<jakarta.persistence.EntityManagerFactory> event)
      Specified by:
      onCreated in interface io.micronaut.context.event.BeanCreatedEventListener<jakarta.persistence.EntityManagerFactory>