Start your Java application with the profiler agent using this instruction.
For communication with profiler UI profiler agent opens TCP port. To provide better security profiler agent will not accept remote connections by default. Although this can be changed, exposing profiler agent port is a bad idea. Secure network communication with SSH protocol can be a useful alternative.
In this example we will use SSH connection to the Amazon EC2 instance to profile a Java application. First you need to know a public IP address. Select your instance in EC2 Management Console and find the address at "IPv4 Public IP" in "Description" tab.
To get authentication key see "Key pair name" in "Description" tab and locate the corresponding key on your computer. We will use key pair aws-key-pair and aws-key-pair.pem file, which was generated by the Management Console.
Amazon Linux image, like in this example, has default user with the name ec2-user. If you have different image, please see its documentation or consult system administrator to obtain your authentication settings.
Use Profile remote Java EE server or application... action on Welcome screen or in "Tools" menu.
In the opened dialog enter public IP address noted above in the "Host or IP address" field.
Choose "Advanced" application discovery method and provide SSH user and SSH port in the corresponding fields.
Click on Authentication settings... and provide the private key.
Created connection will appear in the "Monitor Applications" list on Welcome screen.
In the first communication profiler will upload all necessary files, and you will see "Connecting..." message. This might take up to a few minutes depending your network speed.
You will see applications running with the profiler agent marked with green circle. Click on the application name to connect and profile it.
Applications without the profiler agent are marked with orange circle. You can attach and profile the application, by clicking on its name. Please note that you will not see applications running under a different user, unless your start it with the profiler agent.
If you do not see your application it the list, please read Troubleshoot connection problems.