Deploying an app can be a risky event—when your app breaks, and a bad deployment is often the cause. New Relic allows you to track deployments so you can correlate deployments with changes in your app's performance. Tracking deployments creates deployment markers that appear in APM charts and dashboards.
See how deployment markers work in this short video (4:30 minutes):
You can use the New Relic REST API v2 to record new deployments and retrieve a list of past deployments. In addition, some APM agents have agent-specific methods to record deployments automatically.
You can use your Slack integration with New Relic, or a simple webhook, to notify your team in real time of deployments for applications monitored by APM. Slack provides a webhook URL that allows you to post generic JSON that will appear formatted in a chosen Slack channel.
There are a few places where you can view deployments in the New Relic UI after they have been recorded:
- In the activity feed on the APM Summary, Service summary, and entity summary pages.
- On APM performance charts as chart markers (vertical lines with pinheads).
- On dashboard charts as chart markers.
- On the Deployments page for summary performance.
Deployment markers are not available for browser applications yet, but we will be releasing a new API soon that does support that. Contact us through this sign-up form to learn more about participating in a limited preview. Also, see browser releases for a way to tag errors with release versions.
You can use the New Relic REST API v2 to record deployments and get a list of past deployments.
- The examples in this document use
curlas a command line tool. However, you can use any method to make your REST requests. You can also create and view deployments with the API Explorer.
- JSON uses double quotes
"for element names and content. Using single quotes
'will cause errors.
Some agents have additional methods to record deployments:
- All agents: Use the New Relic REST API v2.
- C: No SDK-specific methods. Use the REST API.
- Go: No agent-specific methods. Use the REST API.
- Java: Call the Java agent
- .NET: Use PowerShell and the REST API.
- Node.js: No agent-specific methods. Use the REST API.
- PHP: Use a PHP script.
- Python: Use the
record-deploysubcommand of the
- Ruby: Use a Capistrano recipe.
After a deployment is recorded using the REST API, you can optionally notify a webhook endpoint of the deployment.
The destination of the webhook can be your Slack instance. To use webhooks to set up a deployment notification for a Slack channel:
- Log in to your Slack account as an admin, then go to App directory > Manage > Apps.
- Search for your New Relic app, then select Add configuration.
- From Post to channel, select an existing Slack channel or add a new channel, then Add configuration.
- From the list of options, copy the webhook URL.
- Go to one.newrelic.com > (user menu) > Account settings > Integrations > Deploy notifications > Webhook.
- Paste the Slack webhook URL, then save.
- Optional: Send a test message.
You can also use webhooks, Slack channels, and other options for alert notifications.
This section and the next are about how to use the current deployment markers UI. If you see a blue banner in the UI about being in a limited preview, you have access to the the new UI. In this case, switch to these new instructions.
After you configure the deployment information, you can view and drill down into details:
- Go to one.newrelic.com > All capabilities > APM & services > (select an app) > Events > Deployments.
- Use any of New Relic's standard user interface functions to drill down into detailed information.
- To view details for a particular event, select its date link.
- To view the errors page for this deployment, select the error link.
- To view details for a specific deployment if applicable, select Change log or Change report.
The Change log contains any detail provided through the
changelog parameter when recording the deployment. The Change report displays the behavior of the top ten transactions before and after the deployment.
The Deployments page link for individual deployments appears on the selected app's Summary page in the Events section. For time frames shorter than 14 days, a blue vertical bar on a chart will indicate a deployment. To view summary information about the deployment, mouse over the blue bar.
You can also use the Compare with option on your APM summary page to select a time period to compare the same data. If you enable Compare with, the UI does not show deployment markers.