Skip to content

Metrics Client to send metrics to Telegraf via different protocols with configurable buffering feature

License

Notifications You must be signed in to change notification settings

tmwllc/metrics-client-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metrics-client-node

Build StatusCoverage StatusStandard - JavaScript Style Guide

Metrics Client to send metrics to Telegraf via different protocols with configurable buffering feature

Install

Install with

npm install metrics-client --save

Usage

To get started, initialize a new instance with protocol.

const MetricsClient = require('metrics-client')
var client = new MetricsClient({
      handler: 'telegrafHttpHandler',
      host: 'localhost',
      port: 8186,
      database: 'test',
      maxBufferSize: 0
    })

To send message(s)

client.send(message)

We accept one message or a list of messages, which needs to have a format of

{
    measure: 'measure-name',
    fields: { field1: 123, field2: 'someOtherValse' },
    tags: { tag1: 'tag1', tag2: 'tag2'}
}

To close the client

client.close()

Limitation

We only have 2 handler implementations: telegrafHttpHandler and telegrafUdpHandler. User can provide the implementation of its own handler implementation.

var handler = function(options) {
    return (messages) => {
        // implementation here
    }
}

About

Metrics Client to send metrics to Telegraf via different protocols with configurable buffering feature

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%