strong-agent-statsd
v1.0.6
Published
strong-agent middleware for publishing metrics via statsd protocol.
Downloads
14
Readme
strong-agent-statsd
strong-agent middleware for publishing metrics via statsd protocol.
The statsd protocol is supported by large ecosystem of servers and plugins, allowing publishing into on-premise or custom infrastructure.
See strong-agent.
Integration points
There are a number of integration points where strong-agent metrics can be published into hosted or on-premise monitoring and reporting infrastructure.
- strong-agent metrics can be collected directly using the
require('strong-agent').use()
API, the strong-agent-statsd source may be used as an example. - strong-agent-statsd can publish metrics using the statsd protocol to any of a number of servers
- strong-agent-statd can publish into a custom server written to support existing on-premise infrastructure, the statsd protocol is quite simple.
Most metrics reported by strong-agent are 'gauges', a measured value, but a few metrics are best reported as 'counts', values that count events. There are other statsd data types, but none are relevant to the metrics currently published by strong-agent.
This publisher uses the lynx client.
publisher = require('strong-agent-statsd')([options])
Module returns a constructor for a publisher function. The publisher requires no options, but the following are allowed:
options.host
(String) The host to connect to, the default is localhost, as statsd servers usually run on the same host as the client.options.port
(Number) The port to connect to, the default is8125
, the default port used by the original statsd server and by most others.options.scope
(String) A scope to prepend to the metric name before publication, default is none.
Metrics names are hierarchical dot-seperated strings. When reported by statsd, they will most likely need to fit into a larger hierarchy of all the applications, or perhaps an entire system or company.
Statsd servers usually have the ability to scope metrics reported to them, but if there are multiple clients reporting to the same server, or if the scope should contain information best known to the client (process ID, application name, cluster worker ID) the scoping can occur at source.
Example
Example integration with strong-agent:
require('strong-agent').use(
require('strong-agent-statsd')()
);