Newrelic and Node.js on CloudBees - how to set it up

Written by: Michael Neale

As of just now - CloudBees has Newrelic with Node.js support.

The quickest way to get going with this is to fire up the Node.js clickstart - and once running - flick the switch for Newrelic - and you are done - it will monitor your app for you (click on Services/Newrelic to see your monitoring data in real time from there).

The base plan is free - as always - for all CloudBees users - so you can get a good feel for what it can do for you. Newrelic can monitor performance, benchmark, and even monitor health of your app (you can also trigger webhooks on certain events, get notified etc).

If you have an existing Node.js app and want to enable Newrelic with it, the steps are fairly simple:

  1. Copy this newrelic.js file into your project, alongside your package.json and main js app file.

  2. Add a dependency to newrelic in your package.json like this example.

  3. Add require('newrelic') to your app like this example (in this case I made the require conditional on the newrelic licence variable existing - so you can run your app with or without newrelic)

  4. Enable Newrelic in your CloudBees app - redeploy with the above changes - and you are done!

Of course you can just click here and sit back and let Jenkins do it all for you.

Stay up to date

We'll never share your email address and you can opt out at any time, we promise.