Notify New Relic of Jenkins Deploys
To set this up with New Relic is really simple as it’s just a webhook with some data attached, but I found a Jenkins plugin for New Relic Deployment and since we deploy via Jenkins and use that to notify our slack channels etc, it seemed a natural place to add it.
The instructions are in the plugin and if you don’t have deployments set up for New Relic then clicking on the “Deployments” tab takes you to some surprisingly helpful help content. One thing that was really missing for me (I am mostly writing this post so I remember this) is that it didn’t include information about which revision was deployed. We aren’t using tags (yet!) for deployment so this could be really handy, and it was easy to set up.
I’m using git, so my Jenkins already has the GIT plugin installed (probably yours does too, but it’s worth checking). This makes a bunch of variables available to git. When you configure the New Relic in your Jenkins task, you can add some fields: in the Revision field add ${GIT_COMMIT}
and this will include the commit identifier as a field, which shows in the list of deployments in your New Relic interface.
I love integrating my tools and this is a neat trick that I hope will help us to get a sense of which changes are causing which performance improvements (hopefully only improvements!) and help us to understand the evolution of our deployed-often application.