title: Monitor Tomcats internal threadpool without using JMX in a Spring Boot App
body: <p>I have a simple Spring Boot web application set up for handling incoming http requests.</p>
  
  <p>Using the Java VisualVm I am able to see MBeans such as Tomcat's internal Threadpool. See the following screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/EkqJb.png" rel="nofollow noreferrer">Screenshot of the Java VisualVM's MBean viewer</a></p>
  
  <p>I have successfully used JMX to monitor attributes such as "currentThreadCount" and "currentThreadsBusy". I set up Prometheus to access the monitored attributes as well. This works well.</p>
  
  <p>However, now I wanted to know if it is possible to access these values without using JMX?
  I noticed that the abstract class <a href="https://tomcat.apache.org/tomcat-8.0-doc/api/org/apache/tomcat/util/net/AbstractEndpoint.html" rel="nofollow noreferrer">https://tomcat.apache.org/tomcat-8.0-doc/api/org/apache/tomcat/util/net/AbstractEndpoint.html</a> contains a method called getCurrentThreadCount().
  The class Nio2Endpoint (<a href="https://tomcat.apache.org/tomcat-8.0-doc/api/org/apache/tomcat/util/net/Nio2Endpoint.html" rel="nofollow noreferrer">https://tomcat.apache.org/tomcat-8.0-doc/api/org/apache/tomcat/util/net/Nio2Endpoint.html</a>) extends AbstractEndpoint. So I imagine that this might be a way to retrieve these values.</p>
  
  <p>Unfortunately I am not able to access the endpoints in any way. Can anybody tell me if it is possible at all to access them without using JMX? </p>
  
  <p>Thank you very much!</p>