Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chkal/prometheus-tomcat

Prometheus Java collector for Apache Tomcat
https://github.com/chkal/prometheus-tomcat

java monitoring prometheus

Last synced: about 6 hours ago
JSON representation

Prometheus Java collector for Apache Tomcat

Awesome Lists containing this project

README

        

# Prometheus Tomcat

This project builds on top of [Prometheus JVM Client](https://github.com/prometheus/client_java) 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`:

```xml

de.chkal.prometheus.tomcat
prometheus-tomcat
1.0.0

```

## Configuration

Please note that you have to first set up the [Prometheus JVM Client](https://github.com/prometheus/client_java)
as described in the corresponding documentation.

Then register the Tomcat collectors just like other collectors.

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

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

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

And that's it. :-)