Monitor deployments (Java agent)

New Relic allows you to send information about application deployments via the command line. Then, you can view deployment information on the Deployments page in the UI: Go to rpm.newrelic.com/apm > Applications > (select an app) > Events > Deployments.

Access to this feature depends on your subscription level.

Installation

Part of the installation process involves changing the app_name in your newrelic.yml file to a meaningful name. The deployment upload script will use this name to associate all of the instances for the app with the deployment. For example, if you set the deployment marker and push 100 instances of the app, the Deployments page will show one deployment for the 100 instances.

As part of the installation process, after changing the app_name, add this entry to newrelic.yml in the common section:

api_host: rpm.newrelic.com

Command line

To send deployment information to New Relic from the Java agent jar, execute the following command from the command line:

java -jar newrelic.jar deployment DEPLOYMENT_OPTIONS

You can include these optional values with the deployment command:

Deployment option Description
--appname=NAME Set the application name. Defaults to app_name setting from newrelic.yml.
--environment=NAME Override the JAVA_ENV environment variable and newrelic.environment system property.
--user=USER Specify the user who is deploying the change.
--revision=REV Specify the revision being deployed.

--changes

Read in a change log from the standard input. For example, you can pipe the change log:

echo "get SHA-1 34837888734" | java -jar newrelic.jar deployment DEPLOYMENT_OPTIONS --changes

Other deployment options

You can also record deployments with the New Relic REST API v2.

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.