NOTE
StrongLoop Arc and slc are no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata

Overview

Icon

To generate and view metrics, you must have:

  • A standard set of C++ compiler tools on the system running the application.  See Installing compiler tools for more information.
  • A valid StrongLoop license key on the system running the application.
    You automatically get a free trial license valid for 30-days from when you first run Arc that applies to apps running locally within Arc. See Managing your licenses for more information.

Setting the metrics URL

To set up metrics monitoring, specify a metrics URL, which can specify either a third-party console (StatsD, Graphite, or Splunk) or a log file.  You can specify the metrics URL:

  • With the STRONGLOOP_METRICS environment variable.  
  • When you install StrongLoop Process Manager as a service (for production use).
  • With the slc ctl env-set command.  

Setting the metrics URL with an environment variable

You can set the environment variable on the system running StrongLoop PM:

Where <url> is one of the metrics URLs  described below. 

Then deploy the application to the system running StrongLoop PM.

Setting the metrics URL during Process Manager service installation

To set the metrics URL when you install StrongLoop Process Manager as a service, use the command:

If installing with Docker, use:

Where <url> is one of the metrics URLs described below.  See Setting up a production host for more information.

Setting the metrics URL at runtime

Once the application is already running or deployed, use the slc ctl env-set command to set the environment variable on the system running StrongLoop PM.  StrongLoop PM will automatically restart the application with the new setting; for example, if the service name is my-app:

Running the app

Once you have set the metrics URL, run the application under control of StrongLoop Process Manager.

For example, to run a local application called my-app:

To run a remote application (typical in production):

  1. Build the application with slc build; see Building applications with slc.
  2. Install StrongLoop Process Manager as a service on the production system; see Setting up a production host.
    If you have not already set the STRONGLOOP_METRICS environment variable, you can set it as described above in Setting the metrics URL during Process Manager service installation 
  3. Deploy the application to the production host with slc deploy; see Deploying apps to Process Manager.

Metrics URLs

Icon

Metrics URLs can take the form of a StatsD, Graphite, or Splunk URL or a log file specification.

StatsD

StatsD is a simple protocol for log information along with a simple daemon (server) that aggregates and summarizes application metrics. The client communicates with the StatsD server using the StatsD protocol, and the daemon then generates aggregate metrics and relays them to a graphing or monitoring backend.  For more information on StatsD, see StatsD, what it is and how it can help you

The StatsD Node server:

Other metrics consumers, such as DataDog, have agents that support the StatsD-protocol.  

To use StatsD, set the STRONGLOOP_METRICS environment variable to a StatsD receiver URL of the form:

statsd://[host[:port]][/scope]
Where:

  • host is the name of the host where the StatsD server is running; default is "localhost".
  • port is the TCP port the StatsD server is using; default is 8125.
  • scope is a string to scope or identify metrics; for example this might be the name of the application or module.

You can set the environment variable before you deploy your application to Process Manager.  

To set it after you deploy the application, use the slc ctl env-set command, which will automatically restart the application with that environment variable.  For example:

Example output:

Hosted Graphite

To use Graphite, set a metrics URL of the form:

graphite://[host[:port]]
Where:

  • host is the name of the host where the Graphite server is running; default is "localhost".
  • port is the TCP port the Graphite server is using; default is 2003.

This specifies to forward metrics data to hosted Graphite. 

For example:

Splunk

To use Splunk, set a metrics URL of the form:

splunk://[host]:port
Where:

  • host is the name of the host where the Splunk server is running; default is "localhost".
  • port is the TCP port the Splunk server is using; you must provide a value since the protocol has no assigned port.

This specifies to write to Splunk using a UDP key-value protocol.   

For example:

Log file

To send metrics information to a log file, set a metrics URL of the form:

log:[file]
If you omit the file name, by default metrics information is send to the console (stdout).

For example:

Syslog

To write metrics information using syslog, set a metrics URL of the form:

syslog:[?[application=appname][&priority=level]]
Where:

  • appName is any string; default is "statsd".
  • priority is any of the following values: 
    • LOG_DEBUG
    • LOG_INFO (the default)
    • LOG_NOTICE
    • LOG_WARNING
    • LOG_CRIT

For example: