Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to monitor Threads in AWS

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?

like image 547
RoddyRott Avatar asked Sep 20 '25 05:09

RoddyRott


2 Answers

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.

like image 118
Julio Faerman Avatar answered Sep 22 '25 01:09

Julio Faerman


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.

like image 22
chris Avatar answered Sep 22 '25 01:09

chris