Class 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 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 interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • initSystemMetrics

        @PostConstruct
        public void initSystemMetrics()
      • 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 Hibernate SessionFactory via this method.