Search in sources :

Example 1 with TomcatMetrics

use of io.micrometer.core.instrument.binder.tomcat.TomcatMetrics in project spring-boot by spring-projects.

the class TomcatMetricsBinder method onApplicationEvent.

@Override
public void onApplicationEvent(ApplicationStartedEvent event) {
    ApplicationContext applicationContext = event.getApplicationContext();
    Manager manager = findManager(applicationContext);
    this.tomcatMetrics = new TomcatMetrics(manager, this.tags);
    this.tomcatMetrics.bindTo(this.meterRegistry);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) WebServerApplicationContext(org.springframework.boot.web.context.WebServerApplicationContext) Manager(org.apache.catalina.Manager) TomcatMetrics(io.micrometer.core.instrument.binder.tomcat.TomcatMetrics)

Aggregations

TomcatMetrics (io.micrometer.core.instrument.binder.tomcat.TomcatMetrics)1 Manager (org.apache.catalina.Manager)1 WebServerApplicationContext (org.springframework.boot.web.context.WebServerApplicationContext)1 ApplicationContext (org.springframework.context.ApplicationContext)1