Monitor deployments

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: From the New Relic menu bar, select APM > Applications > (selected app) > Events > Deployments.

Access to this feature depends on your subscription level.

Installation

As part of the installation process, change the default app_name in your newrelic.yml file to a meaningful name. This will assign instances in the given environment the label given by app_name when browsing your data in the New Relic UI.

To include the app name and host information in your newrelic.yml file:

  1. Download the latest version of the New Relic Java agent.
  2. Change the default app_name in your newrelic.yml file to a meaningful name.
  3. Add this entry to newrelic.yml in the common section:

    api_host: rpm.newrelic.com

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.

Command line

To send deployment information to New Relic from the Java agent jar: From the command line, execute the following command, using any of the available options:

java -jar newrelic.jar deployment [options]

Optional values you can include with the deployment command include the following, where description is short text. Also, if you use --changes, you can pipe the change log into the command.

deployment [OPTIONS] [description]:
   --appname=name            Set the application name
                             Default is app_name setting in newrelic.yml
   --environment=name        Override the JAVA_ENV environment variable
                             and newrelic.environment system property
   --user=USER               Specify the user deploying
   --revision=REV            Specify the revision being deployed
   --changes                 Read in a change log from the standard input

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.