metronic-boundary

0.1.1 • Public • Published

metronic-boundary

A Boundary adapter for metronic that tries to keep things simple. Intended for use with the metronic-rabbit module.

Note: This is alphaware and will quite likely change in terms of how it interacts with Boundary.

How It Works - READ THIS FIRST

Not For Direct Inclusion In Your Apps/Services

This adapter will shutdown the process under the following circumstances:

  • The e-mail and token are missing or invalid
  • Metrics could not be retrieved from Boundary
  • There have been more than 2 consecutive failures to post measures to a metric

This approach is intended to alert operations to a potentially serious issue and avoid losing metrics. The metronic-rabbit adapter uses noAck, auto-delete, non-durable queues; while this makes for very fast publishing, it also means the receiving adapter service should shut down when unable to publish messages to the intended end-point.

Metric Creation

This adapter will create metrics on the fly in Boundary as metronic pushes metrics to it. This is a rather naive approach but avoids the need to predefine every metric in your system with Boundary in advance.

Namespace

!!! IMPORTANT !!! Without a namespace, this plugin cannot guarantee unique metric names and may fail to create metrics (and therefore fail to post measures to Boundary).

There is no default for this setting - you must provide your own.

Checking for Existing Metric Definitions

When the adapter starts, it requests a metric list from Boundary so that it does not change any existing metric definitions. The expectation is that you would be able to customize any metric created by this adapter after the fact.

Metric Types

Since metronic supports custom types, you can specify Boundary friendly types (duration, byteCount, number and percentage). This adapter also attempts to map specific types to those and choose a sensible default based on the type:

Metronic Type Boundary Type Aggregate
time duration avg
meter number sum
bytes byteCount sum
percent percent avg

Configuration

The adapter requires two properties: your account e-mail and the API token to use. Without these, you'll get an exception and the adapter will shutdown the process.

If your metrics include a custom prefix, you'll need to set hasPrefix to true so that the adapter will know how to split up incoming keys into a source and name.

{
    namespace: 'blah',
    email: 'me@self.com',
    token: 'thisismytoken',
    hasPrefix: true
}

Use

This example shows how to configure this Boundary adapter for use with the RabbitMQ adapter on the subscriber side in order to create a service that publishes metrics off the queue to Boundary.

var metronic = require( 'metronic' )();
// default values shown
var boundary = require( 'metronic-boundary' )(
    {
        namespace: 'blah',
        email: 'me@self.com',
        token: 'thisismytoken',
        hasPrefix: true
    }
);
metronic.use( boundary );
 
var config = { ... };
require( 'metronic-rabbit' )
    .subscriber( metronic, config );

Readme

Keywords

none

Package Sidebar

Install

npm i metronic-boundary

Weekly Downloads

1

Version

0.1.1

License

MIT License - http://opensource.org/licenses/MIT

Last publish

Collaborators

  • arobson