outflux

Hapi plugin for sending metrics to InfluxDB.

Usage no npm install needed!

<script type="module">
  import outflux from 'https://cdn.skypack.dev/outflux';
</script>

README

outflux

Build Status

Hapi plugin for sending metrics to InfluxDB.

Overview

npm install outflux

outflux provides the ability to send metrics to InfluxDB from Hapi plugins.

exports.register = function (plugin, options, done) {
    . . .
    plugin.plugins.outflux.point("metric", { a : 1, b : 2 });
    . . .
};

Configuration

The outflux plugin can be configured with the following options:

name required description
url yes The Influx series URL.

The series URL should be the fully qualified URL (including the username and password) as specified in the InfluxDB documentation. For example http://example.com/db/somedb/series?u=username&p=password.

API

outflux.point (type, data)

parameter description
type The type of point to create.
data The data point.

Creates a new data point. The data object is a standard JavaScript object. The key names are used as the column names for the point. Points are batched on one second intervals to improve performance. Returns a promise that is resolved or rejected when the point is actually sent to the server depending on whether or not the request was successful.