There are many ways to monitor a Tomcat application server. Java Management Extension (JMX) interface can be used to collect metrics about the server. Application logs can be monitored to determine errors that happen. The application process can be tracked to determine times when the server restarted. However, no matter how well the application server is monitored, there are going to be gaps in visibility that can be gleaned by looking at the server from within, such as relying on its own logging and APIs.
For example, see the below image that shows how request processing in Tomcat works. Incoming connections are placed in an accept queue. An acceptor thread picks up connections from the accept queue and passes them to worker threads.
How request processing works in Tomcat application server
The number of worker threads configured in Tomcat is limited. When request processing in Tomcat is slow, more connections get placed in the accept queue. The length of the accept queue is bounded, so when the queue is full, new connections will be dropped by Tomcat. This can result in users seeing errors when they access the application hosted on Tomcat. Currently, there is no way to track the occupancy of Tomcat's accept queue. Hence, it is important to monitor whether a Tomcat server is able to service inbound requests or not by simulating requests to the server and observing the response from the server. If the connection to the Tomcat server fails, chances are that the Tomcat server's accept queue is full or it's too small to handle the incoming workload.