hapi-datadog

0.0.3 • Public • Published

Hapi Datadog Reporter

hapi-datadog is a hapi plugin which reports metrics and events to DataDog.

⚠️ This plugin is built for Hapi 8 and doesn't currently support any older versions.

🚧 This plugin is still in it's initial stages of development and shouldn't be used in production.

Installation

Firstly install the node module:

npm install --save hapi-datadog

Then add the plugin to your server:

var Hapi = require('hapi');
var HapiDatadog = require('hapi-datadog');
var StatsD = require('node-dogstatsd').StatsD;
 
var server = new Hapi.Server();
 
server.register({
  plugin: HapiDatadog,
  options: {
    stats: new StatsD(),
  }
}, function (err) {
  if (err) {
    console.error(err);
    return;
  }
});

❕ Note that you will need to have the DataDog agent installed on your server so that stats can be reported back.

Stats collected

Metrics

  • http.response.count as a counter for the number of requests
  • http.response.time as the time taken to send a response to the request

Tags

  • request-host:{request.info.host}
  • route-path:{request.route.path}
  • route-method:{request.route.method}
  • route-vhost:{request.route.vhost}
  • response-status:{request.response.statusCode}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i hapi-datadog

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • josiah