Over a million developers have joined DZone.

Notify New Relic of Jenkins Deploys

A quick tutorial on using New Relic's Jenkins plugin to ping your notification system of choice.

· DevOps Zone

The DevOps zone is brought to you in partnership with Sonatype Nexus. The Nexus suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

I'm a fan of Jenkins as a build server, and on one particular project we've also started using New Relic (I haven't figured out how to blog fun things about New Relic without sharing graphs of client applications which doesn't seem like a cool thing to do). New Relic has a feature where you can notify it when you do a deployment, and it shows on the graphs a line marking when that happened, which is super useful for correlating performance changes with code changes.


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.

The DevOps zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today

jenkins,devops,performance,new relic

Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}