How to Attach Profiler via SOCKS proxy

Questions about YourKit Java Profiler
Post Reply
jeffreyfquinn
Posts: 1
Joined: Fri Sep 23, 2016 11:30 pm

How to Attach Profiler via SOCKS proxy

Post by jeffreyfquinn »

Hello,

I would like to attach the profiler to a remote jenkins worker machine.

Our jenkins setup is such that we can only ssh into the master node, and only from there access the slave nodes which are actually running the JVM we wish to attach to.

I am able to reach the profiler via HTTP through my browser (with the help of the Chrome FoxyProxy plugin), after setting up a SOCKS proxy via a command like this:

Code: Select all

ssh -L 8157:localhost:8002 user@jenkins-master -t ssh -D 8002 user@jenkins-slave
However when I enter a command like this into the YourKit connect to remote application dialog, it is rejected. It seems that dialog only supports the simple case of SSHing directly to a machine (and the syntax of that dialog is a little confusing to me, I'm not sure if it honors ssh_config or the options it is using for ssh tunneling).

Earlier on these forums someone suggested using the -DsocksProxyHost and -DsocksProxyPort JVM options, I attempted to add these to the JVM options YourKit client is launched with by editing

Code: Select all

/Applications/YourKit-Java-Profiler-2016.02.app/Contents/Info.plist
, but the profiler was still showing JVMs on my local machine so I don't believe this worked.

Any suggestions??

Thanks,

Jeff
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: How to Attach Profiler via SOCKS proxy

Post by Anton Katilin »

Hello Jeff

Capabilities of the built-in SSH tunnel support are described here:
https://www.yourkit.com/docs/java/help/ ... jsp#remote

The syntax is not the same as that of the ssh command. Please try the following in "Connect to remote application":

master_user@jenkins-master:ssh_port jenkins-slave

This should work if jenkins-master has direct connection to jenkins-slave. For a more complex scheme you should establish the SSH tunnel manually.
but the profiler was still showing JVMs on my local machine so I don't believe this worked.
The list of locally running applications always shows only locally running applications. All work with remote applications should be performed by using "Connect to remote application".

Best regards,
Anton
Post Reply