NodeFly 101: Installation, Alerts and Sub-Users for Monitoring Your Node.js Product
NodeFly provides real-time visibility to your Node.js product, bringing your metrics to our dashboard where you can zero in on the data you want. The NodeFly APM also allows you to adjust how you get that data, whether it is by timeframe, by receiving alerts, or by including sub-users.
A few weeks ago, we provided some insight into Node.js application monitoring with the NodeFly dashboard, providing a couple of articles giving some tips for interpreting and reading your data. You can check out part one here and then check out part two here.
This time around we are dialing it back to the basics. Whether you are a NodeFly novice or a tenured user, it’s quite likely that you have some questions about how to get started or how to make use of a certain feature. The good news is that we have answers. And so, without further adieu, let’s take a look at installation, alerts, and subusers.
Installing NodeFly
We’ve worked hard to make installation of our APM easy. Our simple install can be done with either a couple of lines or code or an NPM install. If you're just starting out, use a simple deployment. Our code must be the first require before you load any modules. If you don’t set it up like this, you will not see any data.
require('nodefly').profile( <use value from "How To" page>, [APPLICATION_NAME], options // optional );
We also include details for installing with Nodejitsu, Heroku and AppFog.
Because Nodejitsu provides an environment variable containing your applications subdomain, you can add this to your application name so it will appear in your dashboard.
require('nodefly').profile( '27cc8295add80b4b4abbad5e4090b5a1', [APPLICATION_NAME, process.env.SUBDOMAIN], options // optional );
Since Heroku has no reliable means of deriving the application name from the environment, we suggest using a simple deployment strategy such as:
require('nodefly').profile( '27cc8295add80b4b4abbad5e4090b5a1', [APPLICATION_NAME, ‘Heroku’], options // optional );
Finally, AppFog provides the instance name, and index in an environment variable. As you scale up your applications processes, new apps will appear in the dashboard postfixed by their process number.
var appfog = JSON.parse(process.env.VMC_APP_INSTANCE); require('nodefly').profile( '27cc8295add80b4b4abbad5e4090b5a1', [APPLICATION_NAME, appfog.name, appfog.instance_index], options // optional
For those of you who prefer video tutorials, you can watch this basic set up as well:
http://vimeo.com/nodefly/nodeflyinstallation
Now, to always have the latest client, ensure that your package.json references the 'stable' tag of the nodefly package:
{ "name": "my-awesome-application", "dependencies": { "nodefly": "stable" } }
Or if you are installing from the command line:
$ npm i nodefly@stable
By the way, the NodeFly dashboard should start to display your data pretty much immediately. And if you are curious about how NodeFly impact your performance, our NodeFly Agent is a whopping 48k and should affect CPU less than 1%.
NodeFly Trivia: The number one problem we encounter when people are not seeing data is that they have not set the NodeFly code as the first require. We weren’t kidding when we said that earlier.
Alerts
The NodeFly agent has the ability to add alerts to make monitoring easier than ever. You can set up alerts for all of the metrics you see graphed on the dashboard: Average Response Time, CPU, Concurrent Connections, Event Loop, and Heap usage.
We’ve made it simple to add alerts - just hit the exclamation mark in the title of the graph. A pop-up window will appear with all the relevant fields waiting to be filled in. You’ll be asked for an email address, and you can multiple addresses by adding addresses after a comma.
A flashing number beside “Alerts” on the website will indicate that you have new alerts. An email will also notify users of the new alert.
The default threshold for alerts is 10ms, but you can customize the alerts with whatever thresholds you want. And since your monitoring needs may change, so we wanted to make it easy to smite any alerts you no longer find useful. Just hit the “delete” button right next to the alerts alert you wish to eradicate.
Want to see a video about alerts? Click here: http://vimeo.com/nodefly/alerts
Subusers
You can share monitoring duties by adding a subuser. A subuser can create and monitor apps just like any other user but their monitored apps will also show up to the 'parent' account user. Note that subusers only see servers they set up on their own – not any parent servers.
To add a subuser, go to your Account Settings and go to the “Add subusers” section. Hit “Invite” and enter the email address. Be sure to provide a valid email address! You’ll get a confirmation and the lucky subuser will get an email with a unique url to go and set up.
Our systems will checks to see if the recipient is an existing user or not. New users will be prompted to sign up, whereas existing users will just be asked for current credentials. We don’t want to surprise them, so they will see who sent the invite!
You will have a list of subusers that will allows you to track who you have set invitations to and who has accepted.
If your team has changed and you no longer require a subuser, simply go to the list of subusers and hit Delete and PRESTO, that subuser has disappeared!
For a video run-through, click here: http://vimeo.com/nodefly/subusers
And there you have it. If you haven’t already installed our agent, you can jump over to http://www.nodefly.com to get started.
The NodeFly team has a long roadmap to improve our product and make your life easier. However, your suggestions and help shape that roadmap! Email us at [email protected] with your thoughts. Also, if you have any problems, just drop us a line at [email protected] and we will get back to you as soon as possible.









