Member-only story
Adding New Relic to a Heroku NodeJs project
I recently got tasked with the need to install New Relic APM for our NodeJs project. Our project is hosted on Heroku with different environments. For the sake of simplicity, we will assume we have development and local for now.
Here is how to proceed. Go to NewRelic and create an account over there. You will be asked to create a password and verify your account. Pretty basic things.
Post that you will greeted with a screen somewhat like this — minus the graph data because you are creating a new project.
It’s pretty easy to get confused with the way things are structured. Keep following and you will be good. Click on Explorer and then click the button that says Add more data. A drawer slides in from the right wherein you have to select NodeJS under App monitoring.
Follow the steps in order -> Begin Installation -> Package Manager (NPM) -> Give an Application Name. Download the newrelic.js file in the next step and place it as the root of your project. Make a small tweak as follows.
Once you are this far, add two values into your .env file. In my case I kept it simple as NEW_RELIC_APP_NAME and…