Skip to main content
Version: v1

New Relic

The New Relic channel records each deployment as a deployment marker in New Relic APM, so you can line up a code change with the performance data around it.

This page is for the lead or DevOps engineer who sends deployment markers to New Relic. It covers the setup steps, every variable the channel reads, and how the channel finds the New Relic application.

Setup​

To set up New Relic notifications, complete these steps:

  1. Create a New Relic User API Key (format: NRAK-XXXXXXXXXXXXXXXXXXXXXX).
  2. In the hosting environment variables of each environment where New Relic APM is configured, such as production and staging, set NEWRELIC_ENABLED (or VORTEX_NOTIFY_NEWRELIC_ENABLED) to true. Leave it unset everywhere else, so other environments make no API calls. The channel treats any non-empty value as on, including false and 0. When both variables are set, VORTEX_NOTIFY_NEWRELIC_ENABLED wins.
  3. Add VORTEX_NOTIFY_NEWRELIC_USER_KEY to your hosting provider's environment variables. Without it, the channel falls back to NEWRELIC_USER_KEY.
  4. Add newrelic to the comma-separated VORTEX_NOTIFY_CHANNELS list in your .env file, for example VORTEX_NOTIFY_CHANNELS=email,newrelic.

Confirm that the next deployment of a branch in VORTEX_NOTIFY_NEWRELIC_BRANCHES recorded a marker. The deployment output on your hosting platform shows Created a deployment notification for application, then [ OK ] Finished New Relic notification., and the marker appears on the application's charts in New Relic.

Environment variables​

See the Notifications overview for the router, what a failed channel stops, the shared VORTEX_NOTIFY_* variables, and the Location column. The following table lists the variables that the New Relic channel reads:

VariableRequiredDefaultLocationDescription
VORTEX_NOTIFY_NEWRELIC_ENABLEDYes, unless NEWRELIC_ENABLED is setNEWRELIC_ENABLEDHostingTurns the channel on; any non-empty value counts
VORTEX_NOTIFY_NEWRELIC_USER_KEYYes, unless NEWRELIC_USER_KEY is setNEWRELIC_USER_KEYHostingNew Relic User API Key
VORTEX_NOTIFY_NEWRELIC_PROJECTNoVORTEX_NOTIFY_PROJECT.envProject name
VORTEX_NOTIFY_NEWRELIC_APP_NAMENo<project>-<label>.envApplication name as it appears in New Relic
VORTEX_NOTIFY_NEWRELIC_APPIDNoLooked up by application name.envApplication ID
VORTEX_NOTIFY_NEWRELIC_DESCRIPTIONNoDefault template.envDeployment description
VORTEX_NOTIFY_NEWRELIC_CHANGELOGNoDescription.envDeployment changelog
VORTEX_NOTIFY_NEWRELIC_USERNoDeployment robot.envUser performing deployment
VORTEX_NOTIFY_NEWRELIC_REVISIONNoVORTEX_NOTIFY_NEWRELIC_SHA, or <label>-<date>-<time> without oneHostingDeployment revision
VORTEX_NOTIFY_NEWRELIC_ENDPOINTNohttps://api.newrelic.com/v2.envAPI endpoint
VORTEX_NOTIFY_NEWRELIC_BRANCHESNomain,master,develop.envExact branch names to record (comma-separated); empty falls back to the default
VORTEX_NOTIFY_NEWRELIC_LABELNoVORTEX_NOTIFY_LABELHostingDeployment label
VORTEX_NOTIFY_NEWRELIC_SHANoVORTEX_NOTIFY_SHAHostingCommit SHA used as the revision
VORTEX_NOTIFY_NEWRELIC_ENVIRONMENT_URLNoVORTEX_NOTIFY_ENVIRONMENT_URLHostingEnvironment URL
VORTEX_NOTIFY_NEWRELIC_LOGIN_URLNoVORTEX_NOTIFY_LOGIN_URLHostingLogin URL
VORTEX_NOTIFY_NEWRELIC_EVENTNoVORTEX_NOTIFY_EVENT, then post_deploymentHostingDeployment event; pre_deployment records nothing

The default application name joins VORTEX_NOTIFY_NEWRELIC_PROJECT and VORTEX_NOTIFY_NEWRELIC_LABEL with a hyphen. These default to the project name and the deployment label, so a main deployment of your_site looks for your_site-main.

When VORTEX_NOTIFY_NEWRELIC_APPID is empty, the channel looks the application up by name. If no application matches, it skips the notification and passes, which is what you want in environments New Relic doesn't monitor. An explicit numeric ID skips that lookup, so an ID that matches no application fails the channel.

The channel fails when New Relic doesn't answer the marker request with HTTP 201. Like most channels, it skips pre_deployment.

An empty VORTEX_NOTIFY_NEWRELIC_BRANCHES falls back to the default list, so list every branch that should record a marker.

Example​

The following chart shows a deployment marker with its time, user, and revision:

New Relic deployment marker