Is there an easy, built-in way to monitor threads of an Java app in AWS? Like thread count, running time, etc. Or do I need a profiling tool?
Can I see thread metrics in AWS X-RAY or is there a way to export JVM metrics to cloudwatch?
There is no totally built-in metric for that, but using the CloudWatch PutMetricData API it's possible to monitor anything. Some folks did that for JMX: https://github.com/mojn/jmx-cloudwatch-reporter
For Tomcat, for example, it would be
Thread Usage
JMX Bean: Catalina:type=Executor,name=[executor name]
Attributes: poolSize, activeCount
https://wiki.apache.org/tomcat/FAQ/Monitoring
X-Ray is for realtime application monitoring, with different instrumentation alternatives.
Cloudwatch monitoring cannot see "inside" an EC2 instance.
You can send custom metrics to Cloudwatch, or use something like New Relic APM, to get more information on what is happening on your instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With