Skip to content

How to log the number of available/used threads in a spring boot (tomcat) based application?

Is there a spring boot config where you can log the number of available/used threads the app server currently has?


You can use the actuator framework.


Then you have to enable tomcat JXM metrics in and expose the metrics endpoint


The go to http://localhost:8080/actuator/metrics/ and you will see all the available metrics.

For example current threads http://localhost:8080/actuator/metrics/tomcat.threads.current