How to configure Tomcat Exporter to scrape metrics from Prometheus?

How to configure Tomcat Exporter to scrape metrics from Prometheus?

To setup exporter, follow the steps given below:
  1. Install a standalone Tomcat-sever or as a container as kubernetes cluster.
  2. Download the Tomcat exporter servlet file in .war format from here.
  3. Rename the file as metrics.war and deploy it in the webapps directory inside the tomcat installation directory.
    If Tomcat-server is deployed as a container, use the 'docker cp' commands to copy files as shown below,
    docker cp metrics.war <TOMCAT_CONTAINER_ID>:/usr/local/tomcat/webapps/metrics.war
  4. Download the following jars:
  5. Copy all jars to $CATALINA_BASE/lib directory.
  6. Restart the tomcat server and access http://host:port/metrics link to verify if exporter is working correctly.
To configure, follow the steps given below: 
  1. Open prometheus configuration file under prometheus deployed directory. (Default config file is prometheus.yml)
  2. Under the scrape configs, add the job and exporter as shown below: (To know more about scrape configuration, click here.)



  3. Now restart Prometheus server.
  4. Query some tomcat metrics to verify if Prometheus can scrape metrics through the exporter. 









                    New to ADSelfService Plus?

                      • Related Articles

                      • Enable Bundled Prometheus Exporter for ClickHouse DB

                        Overview ClickHouse provides a built-in Prometheus exporter that allows monitoring tools like Prometheus to scrape internal metrics directly from the database. This eliminates the need for any external exporter in modern setups. In the default ...
                      • How to configure Prometheus inside Dockerswarm to scrape necessary metrics for Applications Manager?

                        To setup Prometheus inside a DockerSwarm and scrape metrics for monitoring the same in Applications Manager, kindly follow the steps given below: STEP 1 — Ensure Overlay Network Exists The monitoring overlay network must exist before deploying any ...
                      • JDBC data not populated for tomcat added by Prometheus

                        To configure JDBC metrics in tomcat exporter 1) Open the below file from tomcat installation directory. $CATALINA_BASE/conf/server.xml 2) Add the following configuration under <GlobalNamingResources> tag in the server.xml file. <Resource ...
                      • How to enable the prometheus in Podman

                        How to enable prometheus in Podman (Podman-exporter, Node-Exporter) Note: Linux Machine (Ubuntu/RHEL-based) and Podman is already installed. 1. Overview of Monitoring Components Prometheus: Collects and stores metrics from configured targets Podman ...
                      • How to enable the prometheus in kafka

                        How to Configure Kafka Monitoring Using Prometheus Mode Note: This document explains how to configure Apache Kafka monitoring through Prometheus integration in Applications Manager. 1. Overview of Monitoring Components Kafka Broker: Generates JMX ...