• English日本語한국어
  • Log inStart now

AWS Elastic Beanstalk installation for Java

If you are an 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, follow the steps for your platform:

Tomcat Platform

For applications deployed with the AWS Elastic Beanstalk Tomcat Platform:

  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"

To pass the -javaagent flag to the JVM:

  1. In the AWS console, open the Elastic Beanstalk.

  2. Select the relevant region.

  3. Select your environment.

  4. In the left pane, select Configurations.

  5. Scroll to Updates, monitoring, and logging and select Edit in the upper right corner.

  6. Scroll to Platform Software and add the following line to the JVM Options field:

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

Your Elastic Beanstalk will then update your environment.

Java SE Platform

For applications deployed with the AWS Elastic Beanstalk Java SE Platform:

  1. Add the newrelic.jar and newrelic.yml files to your project, such in a subdirectory named opt/newrelic.

  2. To use custom JVM arguments with your Java SE application, we recommend that you include a Procfile at the root of the source bundle of your application. See Java SE documentation for details.

    Pass the -javaagent flag as a JVM argument in the Procfile:

    web:java -javaagent:path/from/bundle/root/to/newrelic.jar -jar <your-application>.jar
  3. Repackage and deploy the source bundle to your Elastic Beanstalk.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.