Tomcat is a popular open source implementation of the Java Servlet specification. For more information visit tomcat.apache.org.
Discovery
Even if the Tomcat plugin is not configured, Stackdriver Monitoring discovers Tomcat services as a web server.
The services discovered are displayed on the Tomcat Services page in the Resources menu. After you install the monitoring agent and configure the Tomcat plugin on your instances, Monitoring populates the Tomcat Services page with inventory and metrics.
Configuring Monitoring to monitor Tomcat
After you install the monitoring agent, use the following instructions to configure the Tomcat plugin on your instances.
Prerequisites
The Tomcat plugin requires version 5.5.0-257 or later of the monitoring agent. To update the agent, see Upgrading the agent.
Tomcat must be set to enable external JMX monitoring. See the JMX documentation at tomcat.apache.org.
Enabling the Tomcat monitoring plugin
Tomcat is monitored via JMX. Monitoring supports monitoring Tomcat version 7. Tomcat version 8 is not currently supported.
On your VM instance, download tomcat-7.conf from the
GitHub configuration repository
and place it in the directory /opt/stackdriver/collectd/etc/collectd.d/
:
(cd /opt/stackdriver/collectd/etc/collectd.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/tomcat-7.conf)
The downloaded plugin configuration file assumes that your Tomcat instance is configured to accept JMX connections on port 9012. If you have configured Tomcat with a different JMX port, as root, edit the file and follow the instructions to change the JMX port settings.
After adding the configuration file, restart the monitoring agent by running the following command:
sudo service stackdriver-agent restart
For more information on the collectd
GenericJMX
plugin used to monitor
Tomcat, see Plugin:GenericJMX.
What is monitored
The full lists of metrics the Tomcat plugin monitors are at Agent metrics: tomcat and Agent metrics: jvm.