Class TomcatMetrics

All Implemented Interfaces:
MeterBinder, java.lang.AutoCloseable

public class TomcatMetrics
extends java.lang.Object
implements MeterBinder, java.lang.AutoCloseable
MeterBinder for Tomcat.

Note: the close() method should be called when the application shuts down to clean up listeners this binder registers.

  • Constructor Summary

    Constructor Description
    TomcatMetrics​(org.apache.catalina.Manager manager, java.lang.Iterable<Tag> tags)  
    TomcatMetrics​(org.apache.catalina.Manager manager, java.lang.Iterable<Tag> tags, mBeanServer)  
  • Method Summary

    Modifier and Type Method Description
    void bindTo​(MeterRegistry registry)  
    void close()  
    static getMBeanServer()  
    static void monitor​(MeterRegistry registry, org.apache.catalina.Manager manager, java.lang.Iterable<Tag> tags)  
    static void monitor​(MeterRegistry registry, org.apache.catalina.Manager manager, java.lang.String... tags)  
    void setJmxDomain​(java.lang.String jmxDomain)
    Set JMX domain.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TomcatMetrics

      public TomcatMetrics​(@Nullable org.apache.catalina.Manager manager, java.lang.Iterable<Tag> tags)
    • TomcatMetrics

      public TomcatMetrics​(@Nullable org.apache.catalina.Manager manager, java.lang.Iterable<Tag> tags, mBeanServer)
  • Method Details

    • monitor

      public static void monitor​(MeterRegistry registry, @Nullable org.apache.catalina.Manager manager, java.lang.String... tags)
    • monitor

      public static void monitor​(MeterRegistry registry, @Nullable org.apache.catalina.Manager manager, java.lang.Iterable<Tag> tags)
    • getMBeanServer

      public static getMBeanServer()
    • bindTo

      public void bindTo​(MeterRegistry registry)
      Specified by:
      bindTo in interface MeterBinder
    • setJmxDomain

      public void setJmxDomain​(java.lang.String jmxDomain)
      Set JMX domain. If unset, default values will be used as follows:
      • Embedded Tomcat: "Tomcat"
      • Standalone Tomcat: "Catalina"
      jmxDomain - JMX domain to be used
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable