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:

  1. Create a New Relic User API Key (format: NRAK-XXXXXXXXXXXXXXXXXXXXXX).
  2. Turn the channel on in each environment where New Relic APM is configured, such as production and staging. In that environment's hosting variables, set NEWRELIC_ENABLED or VORTEX_NOTIFY_NEWRELIC_ENABLED to true:
    • Leave both variables unset everywhere else, so other environments make no API calls.
    • Any non-empty value turns the channel 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. When VORTEX_NOTIFY_NEWRELIC_USER_KEY is unset, the channel uses 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. 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_CHANGELOGNoValue of VORTEX_NOTIFY_NEWRELIC_DESCRIPTION.envDeployment changelog
VORTEX_NOTIFY_NEWRELIC_USERNoDeployment robot.envUser performing deployment
VORTEX_NOTIFY_NEWRELIC_REVISIONNoVORTEX_NOTIFY_NEWRELIC_SHA, or <label>-<date>-<time> when the SHA is emptyHostingDeployment 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, the channel skips the notification and passes, so an environment without APM records nothing. An explicit numeric ID skips that lookup, so an ID that matches no application fails the channel.

The channel fails when New Relic answers the marker request with any status other than HTTP 201. It skips pre_deployment without an error, like every channel except Slack and GitHub.

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

Example​

The following screenshot shows a deployment marker on a New Relic chart, with its time, user and revision:

New Relic deployment marker