Monitoring Apache Tomcat

With Instana, you can comprehensively monitor your Apache Tomcat environment to quickly identify performance bottlenecks and optimize application performance. To monitor Apache Tomcat, install the Instana host agent. After you install the agent, the Apache Tomcat sensor automatically activates, collecting real-time monitoring data that you can view in the Instana UI.

Support information

To make sure that the Apache Tomcat sensor is compatible with your current setup, check the following support information sections:

Supported operating systems

The supported operating systems of the Tomcat sensor are consistent with host agent requirements, which can be checked in the Supported operating systems section of each host agent, such as Supported operating systems for Unix.

Supported versions and support policy

The sensor supports all versions of Apache Tomcat from 5.x to 11.x.

The following table shows the latest supported version and support policy:

Technology Support policy Latest technology version Latest supported version
Apache Tomcat 45 days 11.0.23 11.0.22

For more information about the support policy, see Support strategy for sensors.

Supported client-side tracing

For Apache Tomcat, Instana supports client-side tracing for Java.

Optional configuration

After you install the agent, the Apache Tomcat sensor is automatically installed and deployed. The Apache Tomcat sensor is enabled by default and starts to collect Apache Tomcat monitoring data.

Naming Tomcat

The Apache Tomcat sensor reads the Tomcat configuration file ServerInfo.properties and extracts the name for the Tomcat instances from it. This name is displayed in the Instana UI.

Optionally, you can change the name of the Tomcat instance within Instana by editing the Tomcat configuration file ServerInfo.properties.

To edit the configuration file for renaming the Tomcat instance, complete the following steps:

  1. Go to the following ServerInfo.properties file:
    CATALINA_BASE/lib/org/apache/catalina/util/ServerInfo.properties
     
  2. To change the name of the Tomcat instance, modify the value of the server.info field. See the following example:
    server.info=Apache Tomcat/7.0.x
     

Configuring custom polling rate

Note: Instana Apache Tomcat sensor 1.1.36 and later support configuring the polling rate to reduce data ingestion. This feature is supported on self-hosted Instana backend 311 and later.

You can configure how often Instana polls Apache Tomcat to collect data and metrics by using the poll_rate parameter in the agent configuration.yaml file as shown in the following example:

com.instana.plugin.tomcat:
  poll_rate: 1 # values are in seconds. Default value is 1 second.

Metrics collection

The Apache Tomcat sensor monitors the Apache Tomcat instance and collects the following metrics from it:

To view these metrics, complete the following steps:

  1. Select Infrastructure in the sidebar of the Instana UI.
  2. Click a specific monitored host.

You can see the host dashboard with all the collected metrics and monitored processes.

Configuration data

The Apache Tomcat sensor collects the following configuration data from the Apache Tomcat instance:

Configuration item Description
Version Apache Tomcat version information (for example, 11.0.13)
Home Root directory of the Tomcat installation (CATALINA_HOME) containing binaries, libraries, and configurations
Webapps List of deployed web applications with details, such as name, context, and session details:
  • Context: Represents an individual web application hosted in the Tomcat server
  • Name: Name of the web application
  • Session timeout: Defines users inactivity period before their session is invalidated
  • Number of sessions: Count of the current active user sessions
Servlets Provides information for each registered servlet within a deployed web application including servlet name, requests, average response time, and errors (details available in the Web apps table)
Connectors Displays HTTP, HTTPS, or AJP connector details, such as connector name, thread count, busy threads, maximum threads, port, thread type, and connection:
  • Name: Identifier for the connector instance, for example, http-nio-8080
  • Port: Network port the connector listens
  • Thread type: Determines threading model for request processing
Executors Thread pool executor configurations including thread counts, queue sizes, maximum threads, maximum idle, and core pool
Data sources Database connection pool configurations including JNDI names, JDBC URLs, active connections, and max pool size:
  • Name: JNDI resource name for the DataSource, for example, jdbc/MyDB
  • Context: Application context where the DataSource is defined
  • URL: JDBC connection URL to the database

Performance metrics

The Apache Tomcat sensor collects the following performance metrics from the Apache Tomcat instance:

Metric Description Granularity
Sessions
Session count Number of currently active sessions. Useful for monitoring user activity and session management 1 second
Requests Number of requests received by a servlet per second 1 second
Average Response Times Average time (in milliseconds) taken to process all servlet requests per second 1 second
Errors Number of erroneous requests per second, which helps to track failed requests and application errors 1 second
Connectors
Threads Number of threads that are currently assigned to a connector for processing requests 1 second
Busy threads Number of threads that are currently processing requests, which indicates the current load on the connector 1 second
Maximum threads Maximum number of threads that a pool can contain, which help to determines the maximum concurrent request processing capacity 1 second
Connection count Number of connections that are currently handled by an endpoint, which tracks active network connections 1 second
Maximum connections Total number of concurrent connections that a server accepts and processes 1 second
Connect timeout Maximum time (in milliseconds) that Tomcat waits for a client to send a complete HTTP request after establishing a TCP connection
KeepAliveTimeout Number of milliseconds the connector waits for a subsequent HTTP request before closing the connection
Connectors - Virtual
Connector Name Identifier for the connector
Virtual Threads Number of virtual threads that are currently processing requests 1 second
Executors
Thread count Actual thread pool size for executor services, which dynamically adjusts based on workload and configuration 1 second
Queue size Number of request processing tasks that are currently in the queue of a thread pool 1 second
Maximum threads Maximum number of threads that can be allocated or created in a pool. Sets the upper limit for thread pool growth, balancing concurrency with resource consumption. 1 second
Maximum idle Number of milliseconds an idle thread can remain in the pool before it is terminated
Core pool Minimum number of threads that are always kept alive, including both idle and active threads
Data sources
Active Current number of active connections that are allocated from a particular data source 1 second
Max Maximum number of active connections that can be allocated at the same time 1 second

Health signatures

Each sensor has a curated knowledgebase of health signatures that are evaluated continuously against the incoming metrics. These health signatures are used to raise issues or incidents that depend on user impact.

Built-in events trigger issues or incidents based on failing health signatures on entities. Custom events trigger issues or incidents based on the thresholds of an individual metric of any entity.

For more information about built-events for the Apache Tomcat sensor, see Built-in events reference.