You can monitor your Node.js-based applications using the Linux Agent and Metricly StatsD server. All it takes is installing our agent and instrumenting your custom metrics, and then you’ll be visualizing the performance of your Node.js applications.

For the configuration section and examples, we used the statsd-client library, but you can use any compatible Node.js client library. You can find some popular ones here. Note that while some libraries may support varying metric types, the Metricly StatsD server only supports gauge, set, counter, timer, and histogram types. See the Metricly StatsD server page for more information.


Before you configure metric instrumentation in your Node.js application(s), you’ll need to install the Linux Agent and Metricly StatsD server first. See the instructions on this page for how to install it.

Node.js Configuration

  1. Set the statsd setting in the netuitive-agent.conf file to enabled = True.
    # local statsd server
    enabled = True
  2. Ensure Node.js is installed properly.
  3. StatsD requires a client library to push metrics, so you’ll need to install a Node.js library. For this example, we’ll be implementing the statsd-client. The open source community also has many Node.js libraries for StatsD that should all work with our agent.
    If the client library is installed locally, please be sure to have the Node.js web server in the same directory.
    npm install statsd-client
  4. Import the client into your application file and specify the location of the Metricly StatsD backend. By default, the Metricly StatsD runs on localhost port 8125 (as specified in the /opt/netuitive-agent/conf/netuitive-agent.conf file).
    var SDC = require('statsd-client'),
    	client = new SDC({host: '', port: 8125});
  5. Instrument your application code by calling the appropriate functions.

    What follows are examples of how to create metrics using some of the types compatible with the statsd-client library:

    // Counter Increment – Count occurrences of an event
    //Counter Decrement - Subtract values from metrics 
    client.decrement('', -10);
    // Timer – Measure the amount of time anaction took to complete
    client.timing('', 250);
    // Gauge – Set an static value andcompare against it to evaluate fluctuations
    client.gauge('', 5);
    // Histogram - Create a histogram with tags
    client.histogram('', 10, {foo: 'bar'})

    These metrics will show up under the statsd node in the Metrics page like so:
    Nodejs setup metrics screenshot

  6. Save your application, and then restart your application and the Linux Agent.


Redhat 6 and 7
CentOS 6 and 7
Amazon Linux (latest)
Ubuntu 12, 14, 15, and 16
Debian 7, 8, and 9


Linux Agent
Metricly StatsD Server
Node.js Client Library