Monitor Apache Tomcat connection pools, thread pools, and web request performance with JMX metrics for Java application servers.
Use this extension collects connection pool, thread pool, and web request activity and performance for Tomcat.
Apache Tomcat is an open-source web server developed by the Apache Software Foundation (ASF) and one of the most popular servlet containers available today. It’s an incredibly lightweight, flexible and extremely stable platform to build on. The OneAgent will allow you to trace activity on and through your Tomcat applications. Using this JMX extension you'll be able to collect additional key performance data to identify issues and optimize your Tomcat configurations.
To get metric insight:
Java Metric Extensions 2.0 (JMX).
The following Mbeans are used for collecting data. If you don't see the metrics, check that the following Mbeans exist using the tool of your choice (e.g. JConsole).
Catalina:type=DataSource,name=*,class=*,context=*,host=* or Catalina:type=DataSource,name=*,class=*Catalina:type=ThreadPool,name=*Catalina:type=GlobalRequestProcessor,name=*For connection pools specifically, this extension only supports the standard Tomcat connection pooling implementation with Mbeans under the Catalina domain. It is not uncommon for a different pooling implementation to be used and in these cases you may need to create your own custom JMX extension to collect similar data (if it is available via JMX). You should consult your implementation's documentation or review available Mbeans in your Tomcat process to get started with this.
Metrics are organized into feature sets you can enable/disable as desired.
Additionally, there is one calculated metric included:
func:tomcat.processingTimePerRequest): Request processing time divided by request countThere is no charge to use the extension. You are only charged for the data that the extension ingests.
The Tomcat (JMX) extension ingests custom metrics, which consume Davis Data Units (DDUs) (Dynatrace classic license) or Metrics powered by Grail (DPS), according to your license model.
The following formula provides the number of metric data points per minute, assuming all feature sets are enabled.
(16 * <number_of_connection_pools>) + (5 * <number_of_web_apps>) + (3 * <number_of_thread_pools>)
In the Dynatrace Platform Subscription, metric ingestion consumes Metrics powered by Grail according to the number of ingested metric data points.
To calculate the approximate yearly consumption, apply the following calculation: <metric data points per minute> * 60 minutes * 24 hours * 365 days.
In the classic licensing model, metric ingestion consumes Davis Data Units (DDUs) at the rate of .001 DDUs per metric data point. Multiply the above formula for annual data points by .001 to estimate annual DDU usage.
The DDU cost above does not include any possible log events or custom events that are triggered by the extension. For more information, see DDU events.
When activating your extension using a monitoring configuration, you can limit monitoring to one of the feature sets. To work properly, the extension has to collect at least one metric after the activation.
In highly segmented networks, feature sets can reflect the segments of your environment. Then, when you create a monitoring configuration, you can select a feature set and a corresponding ActiveGate group that can connect to this particular segment.
All metrics that aren't categorized into any feature set are considered to be the default and are always reported.
A metric inherits the feature set of a subgroup, which in turn inherits the feature set of a group. Also, the feature set defined on the metric level overrides the feature set defined on the subgroup level, which in turn overrides the feature set defined on the group level.
| Metric name | Metric key | Description |
|---|---|---|
| Max total connections | tomcat.connectionPool.maxTotal | Maximum total amount of connections |
| Max active connections | tomcat.connectionPool.maxActive | Maximum amount of active connections allowed concurrently |
| Max idle connections | tomcat.connectionPool.maxIdle | The maximum number of connections that should be kept in the pool at all times |
| Max wait time | tomcat.connectionPool.maxWait | The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception |
| Minimum idle | tomcat.connectionPool.minIdle | The minimum number of established connections that should be kept in the pool at all times |
| Metric name | Metric key | Description |
|---|---|---|
| Bytes recieved | tomcat.bytesReceived.count | Bytes recieved |
| Bytes sent | tomcat.bytesSent.count | Bytes sent |
| Request count | tomcat.requestCount.count | Request count |
| Error count | tomcat.errorCount.count | Error count |
| Request processing time | tomcat.processingTime.count | Request processing time |
| Metric name | Metric key | Description |
|---|---|---|
| Borrowed connections | tomcat.connectionPool.borrowedConnections | — |
| Reconnected connections | tomcat.connectionPool.reconnectedConnections | — |
| Released connections | tomcat.connectionPool.releasedConnections | — |
| Returned connections | tomcat.connectionPool.returnedConnections | — |
| Metric name | Metric key | Description |
|---|---|---|
| Active connections | tomcat.connectionPool.activeConnections | Currently used connections |
| Created connections | tomcat.connectionPool.createdConnections | Number of connections created |
| Idle connections | tomcat.connectionPool.idleConnections | Number of open but unused connections |
| Waiting connections | tomcat.connectionPool.numWaiters | Currently waiting connections |
| Abandoned connections | tomcat.connectionPool.removeAbandoned | Number of connections that have not been properly released |
| Abandoned connection timeout | tomcat.connectionPool.removeAbandonedTimeout | Timeout before an abandoned connection can be removed |
| Waiting connection requests | tomcat.connectionPool.waitCount | Number of connection requests currently waiting |
| Metric name | Metric key | Description |
|---|---|---|
| Current thread count | tomcat.threadPool.currentThreadCount | Current thread count |
| Current threads busy | tomcat.threadPool.currentThreadsBusy | Current threads busy |
| Max threads allowed | tomcat.threadPool.maxThreads | Max threads allowed |
| Metric name | Metric key | Description |
|---|---|---|
| Stuck thread count | tomcat.stuckThreads | Stuck thread count |