Numbat-Powered Metrics system: monitoring, alerting, and historical analysis. The collector sits in front of Numbat-Analyzer and InfluxDB in the same way that statsd sits in front of Graphite. This system, however, does absolutely no aggregation or manipulation of the data at all (yet). It merely multiplexes & buffers when necessary.
See numbat-analyzer for more information on the system.
The collector is a service. You are intended to run it anywhere you like, perhaps many instances of it. You could run one on every hosts where you run services and communicate with it using a socket. Or you could run a few collectors and communicate using TCP or UDP.
In production at npm.
> npm install -g numbat-collector
> numbatd configuration.js
The configuration file looks like this:
module.exports =
{
logging:
{
name: 'numbat-1',
silent: false
},
listen: { host: 'localhost', port: 3333 },
outputs:
[
{ type: 'log', name: 'numbat-1', path: './numbat.log' },
{ type: 'analyzer', host: 'localhost', port: 5555 },
{
type: 'influxdb',
hosts:
[
{ host: 'influx-1.example.com', port: 8086 },
{ host: 'influx-2.example.com', port: 8086 },
],
username: 'numbat',
password: 'my-top-secret',
database: 'numbat'
},
{ type: 'prettylog', name: 'foobar' },
{ type: 'graphite', host: 'localhost', port: 3333 },
]
};
The configuration options are described in more detail below.
Logs JSON-formatted data to the console by default.
name: nodename
: name to tag all log entries withsilent: true
: no logging at allNODE_ENV=dev
set in environment: log to console, pretty-printed (no need to pipe to bistre)
listen: { host: '0.0.0.0', port: 3333 }
-- listen for incoming data over tcp on the given portlisten: { host: 'localhost', port: 3333, udp: true }
-- listen for udp datalisten: { path: '/path/to/foo.sock' }
-- connect to the given unix domain socketlisten: { host: '0.0.0.0', port: 3333, ws: true }
-- listen for incoming data over a websocket on the given port
These options are mutually exclusive.
Some running environments restrict the use of raw TCP or UDP sockets. In those situations you might use the websocket transport option instead. For example, certain PaaS providers restrict this. Use this for server-to-server communication, not browser-to-server communication.
The websocket listener obeys these listener options:
When using the websocket option, the following additional parameters can be provided on the listener:
pathname
-- the path the websocket should be exposed at - default: '/'keepAliveFrequency
-- how often in milliseconds the server and client should exchange keep alive messages - default: 3000keepAliveThreshold
-- how many keep alive messages to be dropped before the socket connection is reset - default: 2verifyClient
-- a custom function to validate client access example - default: no validation
influx
: InfluxDB 0.9, client provided by the numbat-influx modulelogfile
: a json-formatted logfile (using bole); in case you want logging for any reasonprettylog
: a pretty-formatted colorized console loganalyzer
: numbat-analyzer, the incomplete alerting & monitoring component of the numbat-powered metrics system.graphite
: Graphite (plain graphite, not statsd)
You can have as many outputs as you want.
Yes, please do! See our contributing guide for basic rules of engagement.