Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.08 KB

README.md

File metadata and controls

45 lines (29 loc) · 1.08 KB

Prometheus Tomcat

This project builds on top of Prometheus JVM Client and provides collectors for Apache Tomcat.

Currently it supports collectors for:

  • The GlobalRequestProcessor
  • Tomcat's session manager

Installation

Add the following dependency to your pom.xml:

<dependency>
  <groupId>de.chkal.prometheus.tomcat</groupId>
  <artifactId>prometheus-tomcat</artifactId>
  <version>1.0.0</version>
</dependency>

Configuration

Please note that you have to first set up the Prometheus JVM Client as described in the corresponding documentation.

Then register the Tomcat collectors just like other collectors.

new TomcatRequestMetricsCollector().register();
new TomcatSessionMetricsCollector().register();

If you want to register the collectors to a specific CollectorRegistry, just pass it to the register() method:

new TomcatRequestMetricsCollector().register(registry);
new TomcatSessionMetricsCollector().register(registry);

And that's it. :-)