Deploying an app can be a risky event—when your app breaks, a bad deployment is often the cause. New Relic allows you to track deployments so you can correlate deploy to your app's performance. Tracking deployments creates deployment markers that appear in APM charts.
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, retrieve a list of past deployments, and delete past deployments on your APM application. 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. You can view deployments in the UI:
- In the activity feed of the APM Summary, New Relic One Service summary, and entity summary pages.
- On APM performance charts as a chart marker.
- On the Deployments page for summary performance.
Deployment markers are not available for browser applications, but see browser releases for a way to tag errors with release versions.
You can use the New Relic REST API v2 to record deployments, get a list of past deployments, and delete 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, view, and delete 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 > (account dropdown) > 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 with New Relic Alerts.
As of September 9, 2019, integrations with Hipchat and Campfire for APM deployment notifications will no longer be available. Recommendation: If you are still using Hipchat or Campfire, use webhooks with Slack channels instead. For more information, see the New Relic Explorers Hub post.