Note this article is hidden. The information is provided in Monitoring with slc.
To enable on-premises metrics collection, you must register with StrongLoop and get a valid license key.
To get a license key, contact sales@strongloop.
|Table of Contents|
Running the app
To display metrics on an application in a third-party console running on a local machine, follow these steps.
Change to the application directory by running this command, where
<my-app>is the application directory:
$ cd <my-app>
Start your application locally under control of StrongLoop Process Manager:
$ slc start
You can view metrics data in a third-party console as described below.
StatsD is a simple protocol used for aggregating log information. StatsD is also 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:
- Includes a built-in Graphite backend that can be local or hosted.
- Supports other backends such Zabbix, DataDog, and so on.
- Supports custom backends.
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:
- 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:
$ slc ctl env-set STRONGLOOP_METRICS=statsd://localhost:8125/app1
Example output for app1:
app1.cpu.user:0.00907|g app1.cpu.system:0.01664|g app1.cpu.total:0.0257|g app1.heap.used:10698193|g app1.heap.total:27423366|g app1.loop.count:127|c
This command forwards metrics data to Hosted Graphite. Host defaults to "localhost", port defaults to 2003.
$ slc ctl env-set STRONGLOOP_METRICS=graphite://[<host>][:<port>]
This command writes to Splunk using a UDP key-value protocol. Host defaults to localhost, and port is mandatory, since the protocol has no assigned port.
$ slc ctl env-set STRONGLOOP_METRICS=splunk://[<host>]:<port>