0.0.1 • Published 7 years ago

xpm-metrics-graylog v0.0.1

Weekly downloads
4
License
-
Repository
-
Last release
7 years ago

Metrics module for Graylog

The Metrics module for logging (node.js > 4.*). Uses graylog2

For example log response time from Google

const Metrics = require('xpm-metrics-graylog');
const metrics = new Metrics({
    servers: [
        {
          host: 'www.xpm.tech',
          port: 12201
        }
      ],
    hostname: 'example.host'
});
const request = require('request-promise');
const params = {
    uri: 'https://www.google.com',
    resolveWithFullResponse: true,
    time: true
};

request(params)
    .then((res) => metrics.logTime('google_response', res.elapsedTime, 'test'));