A Java Agent is an interceptor in front of your main method, executed in the same JVM, loaded by the same system class loader and governed by the same security policy and context. We'll show you how easy it is to set up Java Agent in Jelastic by using New Relic as an example. New Relic is a fantastic tool to monitor performance and pinpoint problems, all the way down to the code.
So, let's get started!
1. Create an environment
1. Go to jelastic.com and sign up if you haven't done so yet, or log in with your Jelastic credentials by clicking the Sign In link on the page.
2. While in Jelastic dashboard, click the Create environment button at the top left.
3. Pick your application server (for example, Tomcat 6) and specify your environment name, for example, newrelic.
Wait just a minute for your environment to be created.
2. Upload New Relic
1. Navigate to newrelic.com and create a free account.
2. Download New Relic agent.
3. Extract files from the zip package you have just downloaded.
4. Go back to Jelastic's dashboard and upload newrelic.jar and newrelic.yml to the home folder.
5. Open variables.conf file (server folder) and specify the path to jar file according to environment variables:
Don't forget to save the changes and restart Tomcat!
3. Application deployment
1. Upload your WAR file to Deployment manager.
2. Deploy it to the environment you have created earlier.
3. Start New Relic
Now you can go to New Relic web site, log in and monitor your application.