# This is the monitoring configuration for Apache Tomcat 7.x and earlier.
# Make sure to enable JMX in your Tomcat configuration.
# Look for TOMCAT_HOST and TOMCAT_PORT to adjust your configuration file.
LoadPlugin java
JVMARG "-Djava.class.path=/opt/stackdriver/collectd/share/collectd/java/collectd-api.jar:/opt/stackdriver/collectd/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"
ObjectName "Catalina:type=ThreadPool,name=*"
InstanceFrom "name"
Type "gauge"
InstancePrefix "connectors-current_threads"
Table false
Attribute "currentThreadCount"
Type "gauge"
InstancePrefix "connectors-busy_threads"
Table false
Attribute "currentThreadsBusy"
ObjectName "Catalina:type=Manager,context=*,host=*"
InstanceFrom "context"
Type "gauge"
InstancePrefix "manager-active_sessions"
Table false
Attribute "activeSessions"
ObjectName "Catalina:type=GlobalRequestProcessor,name=*"
InstanceFrom "name"
Type "counter"
InstancePrefix "request_processor-bytes_received"
Table false
Attribute "bytesReceived"
Type "counter"
InstancePrefix "request_processor-bytes_sent"
Table false
Attribute "bytesSent"
Type "counter"
InstancePrefix "request_processor-processing_time"
Table false
Attribute "processingTime"
Type "counter"
InstancePrefix "request_processor-request_count"
Table false
Attribute "requestCount"
Type "counter"
InstancePrefix "request_processor-error_count"
Table false
Attribute "errorCount"
# When using non-standard Tomcat configurations, replace the below with
#ServiceURL "service:jmx:rmi:///jndi/rmi://TOMCAT_HOST:TOMCAT_PORT/jmxrmi"
ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:9012/jmxrmi"
InstancePrefix "tomcat"
Collect "tomcat_connectors"
Collect "tomcat_manager"
Collect "tomcat_requestProcessor"
ObjectName "java.lang:type=Threading"
Type "gauge"
InstancePrefix "threading-daemon_thread_count"
Table false
Attribute "DaemonThreadCount"
Type "gauge"
InstancePrefix "threading-thread_count"
Table false
Attribute "ThreadCount"
Type "gauge"
InstancePrefix "threading-peak_thread_count"
Table false
Attribute "PeakThreadCount"
ObjectName "java.lang:type=Memory"
Type "memory"
InstancePrefix "memory-heap_usage_committed"
Table false
Attribute "HeapMemoryUsage.committed"
Type "memory"
InstancePrefix "memory-non_heap_usage_committed"
Table false
Attribute "NonHeapMemoryUsage.committed"
Type "memory"
InstancePrefix "memory-heap_usage_used"
Table false
Attribute "HeapMemoryUsage.used"
Type "memory"
InstancePrefix "memory-non_heap_usage_used"
Table false
Attribute "NonHeapMemoryUsage.used"
Type "memory"
InstancePrefix "memory-heap_usage_max"
Table false
Attribute "HeapMemoryUsage.max"
Type "memory"
InstancePrefix "memory-non_heap_usage_max"
Table false
Attribute "NonHeapMemoryUsage.max"
ObjectName "java.lang:type=Runtime"
Type "counter"
InstancePrefix "runtime-uptime"
Table false
Attribute "Uptime"
ObjectName "java.lang:type=OperatingSystem"
Type "gauge"
InstancePrefix "os-open_fd_count"
Table false
Attribute "OpenFileDescriptorCount"
Type "counter"
InstancePrefix "os-process_cpu_time"
Table false
Attribute "ProcessCpuTime"
ObjectName "java.lang:type=GarbageCollector,name=*"
InstanceFrom "name"
Type "counter"
InstancePrefix "gc-collection_count"
Table false
Attribute "CollectionCount"
Type "counter"
InstancePrefix "gc-collection_time"
Table false
Attribute "CollectionTime"
# When using non-standard Tomcat configurations, replace the below with
#ServiceURL "service:jmx:rmi:///jndi/rmi://TOMCAT_HOST:TOMCAT_PORT/jmxrmi"
ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:9012/jmxrmi"
InstancePrefix "jvm"
Collect "jvm_localhost_Threading"
Collect "jvm_localhost_Memory"
Collect "jvm_localhost_Runtime"
Collect "jvm_localhost_os"
Collect "jvm_localhost_gc"
LoadPlugin match_regex
LoadPlugin target_set
LoadPlugin target_replace
Plugin "^GenericJMX$"
PluginInstance "^tomcat.*$"
PluginInstance "tomcat" ""
Plugin "tomcat"
Target "return"
Chain "GenericJMX_tomcat"
PreCacheChain "PreCache"
Plugin "^GenericJMX$"
PluginInstance "^jvm.*$"
PluginInstance "jvm" ""
Plugin "jvm"
Target "return"
Chain "GenericJMX_jvm"
PreCacheChain "PreCache"