Tomcat Performance Monitoring with OpenTelemetry - Key Metrics and Setup Guide Apache Tomcat performance monitoring can be enhanced using OpenTelemetry, which provides a vendor-neutral pipeline for collecting traces, metrics, and logs. The OpenTelemetry Java agent attaches to Tomcat with zero code changes, enabling historical retention, alerting, and correlation of metrics with request traces. This guide outlines setting up Tomcat monitoring with OpenTelemetry, including Dockerized deployment and verification in SigNoz Cloud. Tomcat Performance Monitoring with OpenTelemetry - Key Metrics and Setup Guide Apache Tomcat exposes performance data via JMX Java Management Extensions , giving you access to thread pool usage, request throughput, session counts, and JVM metrics such as heap memory usage and garbage collection. While built-in tools like the Tomcat Manager and JConsole can display this data in real time, they lack historical retention, alerting, and the ability to correlate metrics with request traces. OpenTelemetry solves this by giving you a single, vendor-neutral pipeline for collecting traces, metrics, and logs from Tomcat. The OpenTelemetry Java agent attaches to Tomcat with zero code changes and exports telemetry directly to your observability backend. In this guide, we will set up Tomcat performance monitoring using the OpenTelemetry Java agent, build a Dockerized Tomcat application with demo endpoints, instrument it, and verify traces, metrics, and logs flowing into the observability backend. Prerequisites Before starting, make sure you have the following ready: - Docker and Docker Compose are installed on your machine - A SigNoz account SigNoz Cloud https://signoz.io/teams/ - Basic familiarity with Tomcat you don't need a running Tomcat instance; we will set one up - You will also need Ingestion Key and Ingestion URL from your SigNoz account. For a detailed walkthrough on getting these credentials, see how to get the ingestion key and ingestion url from SigNoz Cloud https://signoz.io/docs/ingestion/signoz-cloud/keys/ . Implementation Roadmap Setting up Tomcat monitoring with OpenTelemetry involves four steps: - Create the project structure with a Dockerfile and demo endpoints - Configure OpenTelemetry environment variables to send telemetry to SigNoz Cloud - Start the stack with Docker Compose - Verify data in SigNoz Cloud The architecture follows the SigNoz Tomcat instrumentation docs https://signoz.io/docs/instrumentation/java/opentelemetry-tomcat/ . Because Tomcat runs on the JVM, the cleanest way to instrument it is the OpenTelemetry Java agent https://signoz.io/blog/opentelemetry-agent/ java-bytecode-manipulation attached with -javaagent : it auto-instruments servlets and common libraries with no code changes, which is why the steps below rely on it instead of a manual SDK setup. The agent handles all three signals traces, metrics, and logs and exports them directly to SigNoz Cloud via OTLP https://signoz.io/blog/what-is-otlp/ . Let's walk through each step. Step 1: Create the Project Structure Create a project directory with the Dockerfile, demo web application, and supporting files: mkdir -p tomcat-monitoring/webapps/ROOT cd tomcat-monitoring Create Dockerfile The Dockerfile uses a multi-stage build: an Alpine stage downloads the OpenTelemetry Java agent, and the Tomcat stage copies it in and attaches it via CATALINA OPTS . tomcat-monitoring/Dockerfile FROM alpine:3.20 AS otel ARG OTEL JAVA AGENT VERSION=2.13.3 RUN apk add --no-cache curl \ && mkdir -p /otel \ && curl -fL "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OTEL JAVA AGENT VERSION}/opentelemetry-javaagent.jar" \ -o /otel/opentelemetry-javaagent.jar FROM tomcat:10.1-jdk17-temurin COPY --from=otel /otel/opentelemetry-javaagent.jar /opt/otel/opentelemetry-javaagent.jar COPY webapps/ROOT /usr/local/tomcat/webapps/ROOT Attach the OTel Java agent at Tomcat startup. ENV CATALINA OPTS="-javaagent:/opt/otel/opentelemetry-javaagent.jar" The agent version is pinned via a build argument OTEL JAVA AGENT VERSION=2.13.3 . This makes upgrades explicit and reproducible. The agent attaches to Tomcat through the standard -javaagent JVM flag, which Tomcat picks up from CATALINA OPTS an environment variable that Tomcat reads at startup to pass extra JVM arguments specifically to the Tomcat process . Demo Web Application Create three JSP pages that give you different types of telemetry to verify in SigNoz: normal requests, slow requests, and errors. /webapps/ROOT/index.jsp is the landing page, which generates standard request traces: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"% < DOCTYPE html