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 Summary
-
Constructor Summary
ConstructorDescriptionHibernateMetricsBinder
(io.micronaut.context.BeanProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistryProvider, Map<String, String> tags) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.persistence.EntityManagerFactory
onCreated
(io.micronaut.context.event.BeanCreatedEvent<jakarta.persistence.EntityManagerFactory> event)
-
Field Details
-
HIBERNATE_METRICS_ENABLED
- See Also:
-
-
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 providertags
- The tags
-
-
Method Details
-
onCreated
public jakarta.persistence.EntityManagerFactory onCreated(io.micronaut.context.event.BeanCreatedEvent<jakarta.persistence.EntityManagerFactory> event) - Specified by:
onCreated
in interfaceio.micronaut.context.event.BeanCreatedEventListener<jakarta.persistence.EntityManagerFactory>
-