Viewing application metrics using third-party consoles
You can monitor your LoopBack® applications by obtaining metrics data. You can send the metrics data to a third-party console, a log file, or syslog.
You enable monitoring for an application by setting the STRONGLOOP_METRICS
environment variable. The value of the environment variable is a metrics URL that specifies the
destination for the metrics data.
apic props:set STRONGLOOP_METRICS=metrics_url --remote --service app_name --organization org_name --server management_cluster_hostname_or_addresswhere:The following sections provide details of the possible logging destinations.
StatsD
StatsD is a simple protocol for log information together with a simple daemon (server) that aggregates and summarizes application metrics. The client communicates with the StatsD server by 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.
Other metrics consumers, such as DataDog, have agents that support the StatsD-protocol.
statsd://[host[:port]][/scope]where:- host is the name of the host where the StatsD server is running; the default
value is
localhost. - port is the TCP port that the StatsD server is using; the default value is
8125. - scope is a string to scope or identify metrics; for example this might be the name of the application or module.
apic props:set STRONGLOOP_METRICS=statsd://myhost:1234/app1 --remote --service myApp --organization myOrg --server myhost.commy-app.cpu.user:0.00907|g
my-app.cpu.system:0.01664|g
my-app.cpu.total:0.0257|g
my-app.heap.used:10698193|g
my-app.heap.total:27423366|g
my-app.loop.count:127|cHosted Graphite
graphite://[host[:port]]where:- host is the name of the host where the Graphite server is running; the
default value is
localhost. - port is the TCP port the Graphite server is using; the default value is
2003.
apic props:set STRONGLOOP_METRICS=graphite://myhost.com:1234 --remote --service myApp --organization myOrg --server myhost.comSplunk
splunk://[host]:portwhere:- host is the name of the host where the Splunk server is running; the default
value is
localhost. - port is the TCP port that the Splunk server is using; you must provide a value because the protocol has no assigned port.
apic props:set STRONGLOOP_METRICS=splunk://myhost.com:1234 --remote --service myApp --organization myOrg --server myhost.comLog file
log:[file]where file is the name
of the log file that you want to send the metrics information to. If you omit the file name, metrics
information is send to the console (stdout).apic props:set STRONGLOOP_METRICS=log:myapp.log --remote --service myApp --organization myOrg --server myhost.comSyslog
syslog:[?[application=appName][&priority=level]]where:- appName is any string; the default value is
statsd. - level is any of the following values:
- LOG_DEBUG
- LOG_INFO (the default)
- LOG_NOTICE
- LOG_WARNING
- LOG_CRIT
apic props:set STRONGLOOP_METRICS=syslog:?application=myApp&priority=LOG_WARNING --remote --service myApp --organization myOrg --server myhost.com