Automatically update New Relic after app deployment.

I use TeamCity to build and deploy web applications. Using curl and an additional build step, I can update New Relic when the build is deployed to production.

Add a Build Step of build runner type Command Line. The command and options are:

curl -H “x-api-key:xxxxxxxxxxxxxxxx” -d “deployment[application_id]=xxxxxx” -d “deployment[host]=%system.agent.name%” -d “deployment[description]=This deployment was sent using curl.” -d “deployment[revision]=”%build.number% https://rpm.newrelic.com/deployments.xml

This will update New Relic with the build agent and build number.