StrongLoop

This add-on is operated by StrongLoop mBaaS

StrongOps add-on via StrongLoop suite

StrongLoop

Last Updated: 19 March 2014

The StrongLoop add-on is currently in beta.

Table of Contents

NodeFly is an add-on for monitoring Node.js applications.

NodeFly injects a lightweight analytics tool into your application allowing you to see exactly what’s going on. The NodeFly agent tracks overall time per request, and reports how much time in MySQL, Redis, and other resources.

NodeFly works well for both development and production, and has helped many people track down memory-leaks and unexpected latencies.

NodeFly is accessible via an API and has supported client libraries for Node.js.

Provisioning the add-on

NodeFly can be attached to a Heroku application via the CLI:

A list of all plans available can be found here.

$ heroku addons:add nodefly
-----> Adding nodefly to sharp-mountain-4005... done, v18 (free)

Once NodeFly has been added a NODEFLY_APPLICATION_KEY setting will be available in the app configuration and will contain the application key required to begin monitoring your application. This can be confirmed using the heroku config:get command.

$ heroku config:get NODEFLY_APPLICATION_KEY
00000000-0000-0000-0000-000000000000

After installing NodeFly the application should be configured to fully integrate with the add-on.

Configuration

Add nodefly to your package.json in your web application:

{
    "name": "my-awesome-application",
    "dependencies": {
        "nodefly": "stable"
    }
}

Enter the following at the top of your module before any other requires:

require('nodefly').profile(
    process.env.NODEFLY_APPLICATION_KEY,
    [process.env.APPLICATION_NAME,'Heroku']
);

You should set APPLICATION_NAME using the command line:

$ heroku config:set APPLICATION_NAME <A short but descriptive name>

Local setup

Environment setup

After provisioning the add-on it’s necessary to locally replicate the config vars so your development environment can operate against the service.

When running locally in development mode, we recommend changing your APPLICATION_NAME environment variable. This will differentiate the development and production environments in your analytics. You do not have to change your NODEFLY_APPLICATION_KEY.

Use Foreman to configure, run and manage process types specified in your app’s Procfile. Foreman reads configuration variables from an .env file. Use the following command to add the NODEFLY_APPLICATION_KEY values retrieved from heroku config to .env.

$ heroku config -s | grep NODEFLY_APPLICATION_KEY >> .env
$ more .env

Dashboard

The NodeFly dashboard allows you to view the metrics collected by the NodeFly agent.

NodeFly Dashboard

The NodeFly Heroku Console can be accessed via the CLI:

$ heroku addons:open nodefly
Opening nodefly for sharp-mountain-4005…

or by visiting the Heroku apps web interface and selecting the application in question. Select NodeFly from the Add-ons menu.

From the console, you can open the dashboard without requiring an additional login, you will be automatically connected to your Heroku instance.

Troubleshooting

After configuration NodeFly is automatic. If you should experience any issues, please let us know immediately. There are a number of ways to get help:

Migrating between plans

Application owners should carefully manage the migration timing to ensure proper application function during the migration process.

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade nodefly:premium
-----> Upgrading nodefly:premium to sharp-mountain-4005... done, v18 ($49/mo)
       Your plan has been updated to: nodefly:premium

Removing the add-on

NodeFly can be removed via the CLI.

This will destroy all associated data and cannot be undone!

$ heroku addons:remove nodefly
-----> Removing nodefly from sharp-mountain-4005... done, v20 (free)