Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Notify New Relic of Jenkins Deploys

DZone's Guide to

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
Free Resource

Download “The DevOps Journey - From Waterfall to Continuous Delivery” to learn about the importance of integrating automated testing into the DevOps workflow, brought to you in partnership with Sauce Labs.

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.

new-relic-deploy












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.

Discover how to optimize your DevOps workflows with our cloud-based automated testing infrastructure, brought to you in partnership with Sauce Labs

Topics:
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 DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

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

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}