Skip to main content
Version: NG-2.13

Tomcat

Introduction

Tomcat is an open-source web server and Java Servlet container developed by the Apache Software Foundation. It provides a platform for running Java-based web applications, including JavaServer Pages (JSP) and Java Servlets.

Getting Started

Compatibility

The Tomcat O11ySource is compatible with all versions equal to or greater than 8.0.0.

Data Collection Method

vuSmartMaps collects health and performance data for Tomcat server using VuNet's vuAppAgent. This agent collects data based on the source configuration.

Logbeat agent is used to collect Tomcat logs.

Prerequisites

Dependent Configuration

To configure this O11ySource, create a 'credential' of type 'user' under the 'Definition' tab.

Inputs for Configuring Data Source

  • Tomcat Server: The IP Address/FQDN of the Tomcat server. This field is the key to identify each server you add here.
  • Period [in seconds]: How frequently data is gathered. The period should be between 60 seconds – 3000 seconds.
  • Port: Provide the port details
  • Application Name: Enter the Tomcat Application Name
  • Credentials: This is optional
  • Access Log Path: Enter the Tomcat access logfile's entire path
  • Error Log Path: Enter the Tomcat error logfile's entire path.
  • Catalina Log Path: Enter the Tomcat catalina logfile's entire path.

Firewall Requirement

To collect data from this O11ySource, ensure the following ports are opened:

Source IPDestination IPDestination PortProtocolDirection
IP address of the Tomcat servervuSmartMaps Data Collector End Point9092*TCPInbound

*Before providing the firewall requirements, please update the port based on the customer environment.

Configuring the Target

Configure Metrics Collection from Tomcat Server

To monitor Apache Tomcat, the target JVM should enable Remote JMX. Set the following system property to enable remote JMX:

-Dcom.sun.management.jmxremote.port=(JMX port)
-Dcom.sun.management.jmxremote.rmi.port=(JMX port)
  • Go to the path where Tomcat is installed and move to the bin directory
  • Create a file as "setenv.sh"
  • Modify the file using vi editor to add and save the following:
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=<port> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
  • Change the file permission as executable - chmod 755 setenv.sh
  • Restart Tomcat using sudo service tomcat restart or using the Tomcat bin directory (shutdown.sh & startup.sh)

Configure Logs Collection from Tomcat Server The Tomcat access log, error log, and catalina logs offer even more specific information about each client request, errors, and Tomcat-specific operations. Your Tomcat access logs can be customized to include information that is more pertinent to your requirements. Tomcat logs are collected by VuNet's Logbeat agent. We need to enhance the current logging format to include the request duration information. The %D variable precisely measures the time taken to handle each request in microseconds. To integrate %D into the log format used by Tomcat, you should make adjustments to your Tomcat configuration file. Typically, this file can be found in the httpd.conf or within dedicated configuration files used by Tomcat.

  • Find your Tomcat configuration file, commonly named server.xml, and open it for editing. Then, search for the access_log directive, as this directive is responsible for defining the log format utilized by Tomcat.
  • Modify the pattern to include %D. For example:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b %D" />

In the above example, we added %D to the end of the log format string.

Configuration Steps

  • Enable the Tomcat O11ySource.
  • Select the Sources tab and press the + button to add a new Tomcat host to be monitored.
  • Set up metrics and log collection configurations. Afterwards, select Save and Continue to proceed with downloading the agents.
  • The following packages will be available for download based on the OS:Vuappagent Install Binary - Downloads the full vuAppAgent package with required configurations for a fresh installationVuappagent config update Install Binary - Downloads the agent configuration package to update an existing vuAppAgent installationLogbeat Install Binary - Downloads the full Logbeat package with required configurations for a fresh installationLogbeat config update Install Binary - Downloads the agent configuration package to update an existing Logbeat installation
  • Download the agent installation or update package, then click Finish to close the data source window.

Metrics Collected

NameDescriptionData Type
@timestampTimestamp of the eventString
timestampThe precise timestamp when the data was recorded, including milliseconds.DateTime64
targetIP Address of the Weblogic ServerString
hostIP Address of the Weblogic ServerString
tenant_idIdentifier for the specific tenant or customer in a multi-tenant environment.LowCardinality(String)
bu_idIdentifier for the business unit.LowCardinality(String)
vublock_nameSpecifies the category or kind of entity or metric being referred to.String
topic_nameThe total time that a server, application, or system has been operational and running without interruptionFloat64
o11ysource_nameSpecifies the category or kind of entity or metric being referred to.String
application_nameName of the application that generated the log entry.String
allowLinkingBoolean flag indicating if linking is allowed for the specific resource.Bool
cachingAllowedBoolean flag indicating if caching is allowed for the specific resource.Bool
sortA floating-point value used to sort or prioritize entries.Float64
KeyPropertyListTyperepresents a list of key-value pairs where each key identifies a specific propertyString
ErrorMessageError message related to the request or operation.String
stateNameName of the current state of the resource or process.LowCardinality(String)
trackLockedFilesBoolean flag indicating if locked files are being tracked.Bool
StatusCurrent status of the resource or process (e.g., success, failure).LowCardinality(String)
trackedResourcesA list or description of resources being tracked.String
modelerTypeType or category of the modeler used for monitoring or metrics.String
SystemCpuLoadCPU load on the system, represented as a floating-point value.Float64
activeSessionsNumber of currently active sessions.Float32
maxActiveSessionsMaximum number of active sessions recorded.UInt32
SystemLoadAverageAverage system load over a specific period.Float64
TotalPhysicalMemorySizeTotal physical memory available on the system.Float64
ProcessCpuLoadCPU load specifically for the process.Float64
currentThreadCountName of the object associated with the log entry.Float32
ObjectNameMaximum number of threads allowed for the application or process.String
maxThreadsAmount of heap memory currently in use.Float32
HeapMemoryUsage_usedMaximum amount of heap memory that can be used.UInt64
HeapMemoryUsage_maxMaximum amount of heap memory that can be used.UInt64
HeapMemoryUsage_committedAmount of heap memory committed for use.UInt64
Usage_usedMemory usage amount for a specific resource or pool.UInt64
UptimeUptime of the server or application in seconds.Float64
NonHeapMemoryUsage_committedAmount of non-heap memory committed for use.UInt64
NonHeapMemoryUsage_maxThe maximum amount of non-heap memory that can be used by the JVM.UInt64
TotalLoadedClassCountThe total number of classes loaded by the JVM since the start.UInt64
OpenFileDescriptorCountThe current number of open file descriptors by the Tomcat process.UInt32
StackTraceThe stack trace captured at the point of error or during thread dumps.String
LockOwnerIDID of the thread that owns a particular lock in the JVM.Float32
BlockedCountThe number of times a thread has been blocked.Float32
ThreadNameThe name of the thread within the Tomcat server.String
BlockedTimeThe total time (in milliseconds) a thread has been blocked.Float32
locksThe list of locks held by the thread.String
WaitedCountThe number of times a thread has waited for a lock.Float32
requestCount_diffThe difference in the request count between two monitoring periods.Float32
errorCount_diffThe difference in the error count between two monitoring periods.Float32
bytesReceived_rateThe rate at which bytes are being received by the server.Float64
bytesSent_rateThe rate at which bytes are being sent by the server.Float64
numActive_diffThe difference in the number of active sessions between two monitoring periods.Float32
numActive_rateThe rate at which active sessions are changing.Float32
LockNameThe name of the lock currently held by the thread.String
WaitedTimeThe total time (in milliseconds) a thread has waited for a lock.String
numIdle_diffThe difference in the number of idle threads between two monitoring periods.Float64
numIdle_rateThe rate at which idle threads are changing.Float64
CollectionCountThe number of times garbage collection has been performed.Float64
CollectionCount_diffThe difference in the garbage collection count between two monitoring periods.Float64
CollectionTimeThe total time spent in garbage collection.Float64
CollectionTime_diffThe difference in the garbage collection time between two monitoring periods.Float64
hitCountThe number of cache hits during a specific period.Float64
hitCount_diffThe difference in the cache hit count between two monitoring periods.Float64
jspCountThe total number of JSP pages processed.UInt32
gcStartTimestampThe timestamp when garbage collection started.String
gcEndTimestampThe timestamp when garbage collection ended.String
MemoryPoolNameThe name of the memory pool managed by the JVM.String
LastGcInfo_durationThe duration of the last garbage collection event.Float32
LastGcInfo_GcThreadCountThe number of threads involved in the last garbage collection event.Float64
LastGcInfo_startTimeThe start time of the last garbage collection event.Float32
LastGcInfo_endTimeThe end time of the last garbage collection event.Float32
MemoryPoolNames_0Name of the first memory pool managed by the JVM.String
MemoryPoolNames_1Name of the second memory pool managed by the JVM.String
MemoryPoolNames_2Name of the third memory pool managed by the JVM.String
jspCount_diffThe difference in the JSP page processing count between two monitoring periods.Float64
rejectedSessionsThe number of sessions rejected by the server due to capacity limits.UInt32
memoryUsageAfterGc_0_initInitial memory usage after the first garbage collection event.Float64
memoryUsageAfterGc_0_maxMaximum memory usage after the first garbage collection event.Float64
memoryUsageAfterGc_0_usedMemory usage used after the first garbage collection event.Float64
memoryUsageAfterGc_0_committedCommitted memory usage after the first garbage collection event.Float64
memoryBeforeGc_0_initInitial memory usage before the first garbage collection event.Float64
memoryBeforeGc_0_committedAmount of memory committed to memory pool 0 before the last garbage collection.Float64
memoryBeforeGc_0_maxMaximum amount of memory available to memory pool 0 before the last garbage collection.Float64
memoryBeforeGc_0_usedAmount of memory used in memory pool 0 before the last garbage collection.Float64
source_idUnique identifier for the data source, which might refer to a specific Tomcat instance or system.String
LoadedClassCountNumber of classesUInt32
TotalLoadedCountTotal number of classes loaded by the JVM since startup.UInt32
UnloadedClassCountNumber of classes that have been unloaded by the JVM.UInt32
ThreadCountCurrent number of threads in the Tomcat server.UInt32
TypeThe type of the object or resource being monitored (e.g., "thread," "class").String
NameThe name of the object or resource (e.g., thread name, class name).String
TotalStartedThreadCountTotal number of threads started by the JVM since startup.UInt32
PeakThreadCountPeak number of threads active at any time since the JVM started.UInt32
ThreadIDUnique identifier for the thread.UInt32
ThreadStateThe current state of the thread (e.g., "RUNNABLE," "WAITING").String
NonHeapMemoryUsage_usedAmount of non-heap memory currently used by the JVM.UInt64
@timestampThe timestamp when the data was collected or recorded.String
timestampThe specific time or date of the event or record.DateTime64
http-codeThe HTTP status code returned by Tomcat (e.g., 200, 404).UInt16
tomcat_access_tatThe time taken to process a request (turnaround time).Float32
tomcat_access_methodThe HTTP method used (e.g., GET, POST).String
tomcat_access_remote_ipThe IP address of the client making the request.String
tomcat_access_urlThe URL of the request received by Tomcat.String
geo_city_nameThe city of the client making the request, based on geolocation.String
geo_country_nameThe country of the client making the request, based on geolocation.String
geo_timezoneThe timezone of the client making the request, based on geolocation.String
application_nameThe name of the application being accessed or monitored.String
doc_typeThe type of document or data being handled.String
vublock_nameName of a specific virtual block or component in the system.LowCardinality(String)
topic_nameName of the topic being monitored or processed.LowCardinality(String)
o11ysource_nameThe name of the source for observability or monitoring data.LowCardinality(String)
targetThe target resource or endpoint being accessed or monitored.String
hostThe hostname of the Tomcat server or the host serving the application.String
scaled_ueiScaled Unique Event Identifier for distinguishing events.Float64
messageLog MessagesString