# Configuration of java hung thread

**URL:** <https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823>\
**Category:** Open Q&A\
**Tags:** java\
**Created:** [November 5, 2018, 4:10pm UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823 "2018-11-05T16:10:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![manish\_bachu](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manish\_bachu](https://community.dynatrace.com/u/manish_bachu)\
**Post date:** [November 5, 2018, 4:10pm UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/1 "2018-11-05T16:10:14Z")

</div>

How can i configure the alert for the java hung thread in DT? I dont see any option in custom alert as well.

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [November 6, 2018, 9:45am UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/2 "2018-11-06T09:45:20Z")

</div>

Per default there is no metric for hung threads.

But uou could add a “hung threads” metric via a [JMX Plugin.](https://www.dynatrace.com/support/help/extend-dynatrace/plugin-sdk/how-do-i-monitor-jmx-metrics-in-my-java-applications/)

---

<div class="post-metadata">

**Author:** ![manish\_bachu](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manish\_bachu](https://community.dynatrace.com/u/manish_bachu)\
**Post date:** [November 6, 2018, 10:29am UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/3 "2018-11-06T10:29:19Z")

</div>

thanks patrick.

While uploading the pulgin under custon plugin, i hope we have to select “One Agent Plugin” right not the “Activegate plugin”

---

<div class="post-metadata">

**Author:** ![mat\_cat\_adn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mat_cat_adn/32/1553_2.png) [@mat\_cat\_adn](https://community.dynatrace.com/u/mat_cat_adn)\
**Post date:** [November 6, 2018, 10:36am UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/4 "2018-11-06T10:36:22Z")

</div>

Hello,

There’s no such metric in DT.

You can create an alert based on Websphere Log.

You could have this kind of error :

_WSVR0605W:  
Thread “WebContainer : 1” has been active for 612,000 milliseconds and  
may be hung. There are 3 threads in total in the server that may be  
hung._

Regards,

Mathieu

---

<div class="post-metadata">

**Author:** ![manish\_bachu](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manish\_bachu](https://community.dynatrace.com/u/manish_bachu)\
**Post date:** [November 6, 2018, 10:45am UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/5 "2018-11-06T10:45:34Z")

</div>

Hello,

But i dont see metric to create a alert for hung thread.

Regards,

Manish Bachu

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [November 6, 2018, 1:19pm UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/6 "2018-11-06T13:19:26Z")

</div>

Correct it is a OneAgent Plugin

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [February 3, 2020, 11:46am UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/7 "2020-02-03T11:46:28Z")

</div>

Hello [@Patrick H.](https://answers.dynatrace.com/users/11534/view.html) [@Julius L.](https://answers.dynatrace.com/users/16467/view.html) [@Sebastian K.](https://answers.dynatrace.com/users/15061/view.html)

I added the following JMX metrics, and since that time, I can see that there is a constant number 6 for all of them.

Do you think that I did some mistakes while adding metrics?

 ![23506-1580730198312.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/e/7ef8fd2f93e01fd335f4a8d3c39ed7167f3ab1fb.png)

 ![23505-1580730083762.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/97df00ece44a94f19ee079aaa92d4eae42adcf77.png)

Regards,

Babar

 ![1580729972343.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5ffca4b9ac1b4f2bc5e0f5cd4ac001ffcca8b4b4.png)

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [February 27, 2020, 7:47pm UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/8 "2020-02-27T19:47:42Z")

</div>

Can you check the values using jconsole or jmxterm?

---

<div class="post-metadata">

**Author:** ![joshua\_danowitz](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@joshua\_danowitz](https://community.dynatrace.com/u/joshua_danowitz)\
**Post date:** [March 9, 2022, 6:01pm UTC](https://community.dynatrace.com/t/configuration-of-java-hung-thread/16823/9 "2022-03-09T18:01:43Z")

</div>

I don’t know if this is still an issue for you but I found that using the “average” aggregation gave me the correct values for declared hung and concurrent hung in my dashboard tiles. Hope that helps!
