Documentation forAppOptics

Tomcat

Overview

This integration collects status metrics from Tomcat.

Setup

The tomcat monitoring is accomplished by bridge plugin which is included with the SolarWinds Snap Agent by default. Follow the directions below to enable it for an agent instance. The bridge plugin utilize Telegraf Tomcat plugin.

Prerequisites

This plugin requires that a user with the manager-status (or any other manager-xxx) role. You can verify the credentials by testing the manager URL:

curl -u tomcat:tomcat "http://127.0.0.1:8080/manager/status/all?XML=true"
# response
<?xml version="1.0" encoding="utf-8"?>
<status>
    <jvm>
        <memory free="398919744" total="514850816" max="954728448" />
        <memorypool name="PS Eden Space" type="Heap memory" usageInit="134742016" usageCommitted="134742016" usageMax="313524224" usageUsed="115931072" />
        <memorypool name="PS Old Gen" type="Heap memory" usageInit="358088704" usageCommitted="358088704" usageMax="716177408" usageUsed="0" />
        <memorypool name="PS Survivor Space" type="Heap memory" usageInit="22020096" usageCommitted="22020096" usageMax="22020096" usageUsed="0" />
        <memorypool name="Code Cache" type="Non-heap memory" usageInit="2555904" usageCommitted="6356992" usageMax="251658240" usageUsed="6296704" />
        <memorypool name="Compressed Class Space" type="Non-heap memory" usageInit="0" usageCommitted="2228224" usageMax="1073741824" usageUsed="2055160" />
        <memorypool name="Metaspace" type="Non-heap memory" usageInit="0" usageCommitted="18743296" usageMax="-1" usageUsed="18251480" />
    </jvm>
    <connector name="ajp-nio-8009">
        <threadInfo maxThreads="200" currentThreadCount="10" currentThreadsBusy="0" />
        <requestInfo maxTime="0" processingTime="0" requestCount="0" errorCount="0" bytesReceived="0" bytesSent="0" />
        <workers></workers>
    </connector>
    <connector name="http-nio-8080">
        <threadInfo maxThreads="200" currentThreadCount="10" currentThreadsBusy="1" />
        <requestInfo maxTime="0" processingTime="0" requestCount="0" errorCount="0" bytesReceived="0" bytesSent="0" />
        <workers>
            <worker stage="S" requestProcessingTime="91" requestBytesSent="0" requestBytesReceived="0" remoteAddr="127.0.0.1" virtualHost="127.0.0.1" method="GET" currentUri="/manager/status/all" currentQueryString="XML=true" protocol="HTTP/1.1" />
        </workers>
    </connector>
</status>

There is more information about how to configure manager application access here.

Configuration

The agent provides an example task file to help you get started quickly, but requires you to provide the correct settings for your Apache server. To enable the task:

  1. Make a copy of the tomcat example task file /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-tomcat.yaml.example, renaming it to /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-tomcat.yaml:

    sudo cp -p /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-tomcat.yaml.example /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-tomcat.yaml
  2. Edit the task file with settings specific to your Tomcat servers, for example:

    If you wish to also collect logs for this service, uncomment the last section in the example task file. For more information on collecting logs, see the logs collector docs.

    ---
    version: 2
    
    schedule:
      type: cron
      interval: "0 * * * * *"
    
    plugins:
      - plugin_name: bridge
    
        config:
          tomcat:
            ## URL of the Tomcat server status
            # url: "http://127.0.0.1:8080/manager/status/all?XML=true"
            ## HTTP Basic Auth Credentials
            # username: "tomcat"
            # password: "s3cret"
            ## Request timeout
            # timeout: "5s"
    
            ## Optional TLS Config
            # tls_ca: /path/to/cafile
            # tls_cert: /path/to/certfile
            # tls_key: /path/to/keyfile
            
            ## Use TLS but skip chain & host verification
            # insecure_skip_verify: false
    
        publish:
          - plugin_name: publisher-appoptics
    
    ## If you want to gather logs for this integration, uncomment the following section.
    #  - plugin_name: log-files
    #    config:
    #      file_paths:
    #        - /var/log/tomcat/*.log
    
    #    publish:
    #      - plugin_name: loggly-http-bulk
  3. Restart the agent:

    sudo service swisnapd restart
  4. Enable the Tomcat integration in the AppOptics UI

On the Integrations Page you will see Tomcat integration available if the previous steps were successful. It may take a couple minutes before the Tomcat integration is identified. Select the Tomcat integration to open the configuration menu in the UI, and enable it. If you do not see it, see Troubleshooting Linux..

Testing Integration

To check if and what metrics can be collected with given configuration, run bridge plugin in debug mode:

/opt/SolarWinds/Snap/bin/snap-plugin-collector-bridge --debug-mode --plugin-config "{\"tomcat\": {}}"

Metrics and Tags

The table below lists each of the metrics gathered from the status endpoint.

Connector Metrics

Metric Description
tomcat.tomcat_connector.bytes_received Total bytes received
tomcat.tomcat_connector.bytes_sent Total bytes sent
tomcat.tomcat_connector.current_thread_count Total thread count
tomcat.tomcat_connector.current_threads_busy Total busy thread
tomcat.tomcat_connector.error_count Total error count
tomcat.tomcat_connector.max_threads Max thread count
tomcat.tomcat_connector.max_time Max response time
tomcat.tomcat_connector.processing_time Max processing time
tomcat.tomcat_connector.request_count Request count

Connector Metric Tag

Name Description
name Name of the web app

JVM Memory Metrics

Metric Description
tomcat.tomcat_jvm_memory.free Free memory in bytes
tomcat.tomcat_jvm_memory.max Max memory in bytes
tomcat.tomcat_jvm_memory.total Total memory in bytes
tomcat.tomcat_jvm_memorypool.committed Committed memory in bytes
tomcat.tomcat_jvm_memorypool.init Initial memory in bytes
tomcat.tomcat_jvm_memorypool.max Max used memory in bytes
tomcat.tomcat_jvm_memorypool.used Used memory in bytes

JVM Metric Tag

Name Description
name Name of the web app
space Name of the space

Navigation Notice: When the APM Integrated Experience is enabled, AppOptics shares a common navigation and enhanced feature set with other integrated experience products. How you navigate AppOptics and access its features may vary from these instructions.

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.