Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Searching Thread Profiles


#1

You’ve taken a thread profile. There’s thousands of nodes. You click “expand all” and perform a search for a specific method. No results.

What?

You scroll down the page. More nodes start to expand.

I already said expand all!

Yes, you did. But if you had thousands of nodes that all tried to display at once, it would likely crash your browser due to all the fancy formatting and instrumentation buttons and settings and etc. etc.

So, the Thread Profiler view uses lazy loading. If you’re not looking at it, it isn’t expanded.

So, what? I’ve got to slowly go through the Thread Profile so everything expands to do a simple search for the method I’m looking for?!

I know! I actually used to do that. Hours spent just trying to get the Thread Profiler to load up just so I could help customers implement Custom Instrumentation. Until I learned:

Appending .json to the end of the Thread Profiler URL will give you the full, raw JSON

For example the url of a Thread Profile looks like:
https://rpm.newrelic.com/accounts/###/applications/###/profiles/###

by simply changing it to this:
https://rpm.newrelic.com/accounts/###/applications/###/profiles/###.json

We can get the full, raw JSON of the thread profile. This lets us easily search that the method we want is collected. I’ve got a browser extension that formats JSON automatically. This lets me follow back up the call stack so I know where to expand the thread profile to find my method.

Let us know if you found this useful below.


#2

Great tip, @jfalleur! I also like to select Filter outliers and then refresh the tree.

This removes nodes with a very low percentage, and can dramatically reduce the number of nodes you have to deal with.


#3

Has this been updated? Not working for me.


#4

I just tested this and it still works. Do you have a link to the thread profile?


#5

Thank you for this great hint,. it works for me to export the stack trace as json, but I wonder how I should format the json to make it useful.

The built- in json viewer of Firefox formats the list structure very strangely and makes a trace of 192 to a file with 3000 lines.

I then saved the json to a file and opened it with Eclipse, which shows just a huge number of unspecified errors. Also the Json plugin for Notepad++ does not format the reasonably. What method do you propose to work with the json-stracktrace?

Kind regards
Wolfgang


#6

I just have a chrome extension “JSON Formatter” but the profiles still aren’t particularly human readable. Mostly I use this to ensure that the method I’m looking for exists in the profile.