Class MicrometerBinderRegistrar
- java.lang.Object
-
- com.atlassian.confluence.impl.metrics.MicrometerBinderRegistrar
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public abstract class MicrometerBinderRegistrar extends Object implements org.springframework.context.ApplicationContextAware
Responsible for registering a bunch of standard meters with Micrometer, gathering and publishing metrics on the JVM, Tomcat, Hibernate and others.This will only happen if
ConfluenceMicrometer.isMicrometerEnabled()
is true.- Since:
- 7.0
-
-
Constructor Summary
Constructors Constructor Description MicrometerBinderRegistrar(io.micrometer.core.instrument.MeterRegistry meterRegistry, MBeanServer mBeanServer, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.hibernate.engine.spi.SessionFactoryImplementor
getTenantedSessionFactory()
Spring will subclass this class and provide the HibernateSessionFactory
via this method.void
initSystemMetrics()
void
initTomcatMetrics()
void
onTenantArrived(com.atlassian.tenancy.api.event.TenantArrivedEvent event)
Some services aren't available until we have a tenant, so defer binding metrics for those until then.void
registerEventListeners()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
unregisterEventListeners()
-
-
-
Constructor Detail
-
MicrometerBinderRegistrar
public MicrometerBinderRegistrar(io.micrometer.core.instrument.MeterRegistry meterRegistry, MBeanServer mBeanServer, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar)
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
initSystemMetrics
@PostConstruct public void initSystemMetrics()
-
initTomcatMetrics
@PostConstruct public void initTomcatMetrics() throws ReflectiveOperationException
- Throws:
ReflectiveOperationException
-
registerEventListeners
@PostConstruct public void registerEventListeners()
-
unregisterEventListeners
@PreDestroy public void unregisterEventListeners()
-
onTenantArrived
@EventListener public void onTenantArrived(com.atlassian.tenancy.api.event.TenantArrivedEvent event)
Some services aren't available until we have a tenant, so defer binding metrics for those until then.
-
getTenantedSessionFactory
protected abstract org.hibernate.engine.spi.SessionFactoryImplementor getTenantedSessionFactory()
Spring will subclass this class and provide the HibernateSessionFactory
via this method.
-
-