metric-reporter-node
v1.0.5
Published
Atom Metric Reporter
Downloads
8
Readme
metric-reporter-node
metric-reporter-node is SDK for Node.JS Javascript to send reports for applications monitoring like: Datadog, Appoptics etc.
Installation
Installation using npm
$ npm install metric-reporter-node --save
Usage
Create metric reporter for specific driver (datadog or appoptics)
// constructor args: <driver_name>, <driver_config>, <flush_interval>, <max_metrics>, <metric_prefix>, <logger_instance>
let reporter = new MetricReporter("appoptics", {token: "test_token"}, 2, 140, "", logger);
Send report
// send args: <metric_name>, <metric_value>, <tags>
reporter.send("test_metric", 1, { test: "" });
Save shutdown reporter:
['exit', 'SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGABRT', 'SIGTERM'].map(function (event) {
process.on(event, () => {
console.info('SIGTERM signal received: ' + event);
reporter.stop();
});
});
Example
You can use our example for sending reports.