AWS Elastic Beanstalk installation for Java

If you are an Amazon AWS Elastic Beanstalk user, the Java agent requires additional configuration.

Prerequisites

Before completing the configuration, you must first:

To complete Java agent installation on AWS Elastic Beanstalk:

  1. In your WAR file, add the newrelic.jar and newrelic.yml files to WEB-INF/lib/.
  2. Repackage and deploy your new WAR file as a new application or an update to a previous application.
  3. Locate and connect to the underlaying EC2 instance. Once connected, find the path to newrelic.jar file using this command - ensure you search one directory at a time. Use either /var or /usr as appropriate.
sudo find </var | /usr> -name "newrelic.jar"

Pass -javaagent flag to JVM

To pass the -javaagent flag to JVM in AWS Elastic Beanstalk

  1. In the AWS console, open the Elastic Beanstalk.
  2. Select the relevant region.
  3. Select your application.
  4. In the left pane, select Configurations.
  5. Open Software Configuration.
  6. In the JVM command line options: field, enter:

    -javaagent:/full/path/to/newrelic.jar
  7. Select Apply to save.

Your Elastic Beanstalk will then update your environment.

For more help

Join the discussion about Java monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.