Splunk AppDynamics

Java - Capture Thread Name

Stephen_Knott
New Member

Is there a way to capture the Thread Name for Business Transactions in Java?
I see RequestGUID and URL are captured when looking through the UI.
Thanks.

Labels (1)
0 Karma
1 Solution

Michael_Horstm1
Explorer

It might not be what you were thinking, but you can split your BT's by thread name in the instrumentation settings for business transactions.  

It works for any existing BT and I've used this for several apps that I needed a given by-thread confirmation or identification of the "flow" to correlate with single procs, or to use in conjunction with other tool's additional insights where my AppD Transaction ID isn't tag-n-trace through the 3rd party tools I may have to use in unique cases where AppD can't cover those apps/tools.

I also  use this method by "Thread ID" at times, which can be very valuable when attempting to determine if a third party's app is ACTUALLY spreading load across the threads, or operating in a single-threaded fashion.  This is actually a feature that using this way, takes hours/days vs what would have taken you months to find in log analysis alone.

image.png

FYI - Above is just a "catch all for anything, split all the things" example.  I would highly recommend you don't use this in Prod as it will likely impact your instances quite seriously.  Instead, try to find your starting point by the given class + method if possible, and then split by thread ID or thread Name.

IDK if that's exactly what you were looking for, but I hope it helps! 🙂

View solution in original post

iamryan
Community Manager
Community Manager

Hi @Stephen.Knott,

Did you see the most recent reply from Michael?

0 Karma

Michael_Horstm1
Explorer

It might not be what you were thinking, but you can split your BT's by thread name in the instrumentation settings for business transactions.  

It works for any existing BT and I've used this for several apps that I needed a given by-thread confirmation or identification of the "flow" to correlate with single procs, or to use in conjunction with other tool's additional insights where my AppD Transaction ID isn't tag-n-trace through the 3rd party tools I may have to use in unique cases where AppD can't cover those apps/tools.

I also  use this method by "Thread ID" at times, which can be very valuable when attempting to determine if a third party's app is ACTUALLY spreading load across the threads, or operating in a single-threaded fashion.  This is actually a feature that using this way, takes hours/days vs what would have taken you months to find in log analysis alone.

image.png

FYI - Above is just a "catch all for anything, split all the things" example.  I would highly recommend you don't use this in Prod as it will likely impact your instances quite seriously.  Instead, try to find your starting point by the given class + method if possible, and then split by thread ID or thread Name.

IDK if that's exactly what you were looking for, but I hope it helps! 🙂

Stephen_Knott
New Member

Thank you.  I think you just confirmed I would need to write code.
It is strange that AppD does have this information (it can split on ThreadId/ThreadName), but it won't let you see this information within business transactions screens.

0 Karma

iamryan
Community Manager
Community Manager

Hi @Stephen.Knott,

I know we are coming back from the holidays. I wanted to bump this conversation to see if you could check out Mario's reply. 
If the reply helped, please click the Accept as Solution button, if not and you need more help, reply to keep the conversation going.

0 Karma

Morelz
Builder

Hi Stephen

What would be your reason for wanting to capture the thread name? Are you referring to having the Business transactions named after the threads instead of the URL's? Or do you just want to extract the thread name as part of the business transaction under data collectors?

0 Karma

Stephen_Knott
New Member

The Thread Name would be useful in coordinating with logs.  Without any changes to apps, most apps print out thread names in their logging pattern.  RequestGUID would not show up unless we plugged in something and made a very specific call and that would mean modifying all apps/all calls to retrieve it once per transaction.

Was hoping it could be retrieve or there would be a trick to make one of the Data Collectors call currentThread.getName to log it with requestGUID.
Thanks.

0 Karma
Get Updates on the Splunk Community!

What's New in Splunk Cloud Platform 9.3.2411?

Hey Splunky People! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2411. This release ...

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...