1.1.6 • Published 6 years ago

statful-relay v1.1.6

Weekly downloads
34
License
-
Repository
github
Last release
6 years ago

Statful Relay

NPM version Build Status

Staful Relay built in NodeJS. This is intended to gather metrics from different sources inside the same network and relays it to a centralized system.

Table of Contents

Supported NodeJS Versions

Statful Collector AWS VersionTested NodeJS versions
1.x.x4 and Stable

Installation

$ npm install -g statful-relay

Quick start

After installing Statful Relay you are ready to use it. The quickest way is to do the following:

$ statful-relay generate-config /etc/statful-relay/conf/

# Update some info in the statful-relay-conf.json: statful api token

$ statful-relay start /etc/statful-relay/conf/statful-relay-conf.json

Examples

You can find here an usage example of the Statful Relay. In the following example are assumed you have already installed the collector globally and followed the Quick Start.

Use a listener for statful metrics and sends them to the public api

{
  "debug": false,
  "listeners": {
    "statful": {
      "port": 2013,
      "address": "127.0.0.1",
      "ipv6": false,
      "stats": false
    }
  },
  "statfulClient": {
    "app": "statful-relay",
    "tags": {
       "env": "readme",
    },
    "transport": "api",
    "api": {
      "token": "STATFUL_API_TOKEN",
      "timeout": 2000,
      "host": "api.statful.com", // Default value
      "port": 443 // Default value
    },
    "flushSize": 1000,
    "flushInterval": 3000,
    "systemStats": false
  },
  "bunyan": {
    "name": "stdout",
    "streams": []
  }
}

Reference

Detailed reference if you want to take full advantage from Statful Relay.

CLI

$ statful-relay generate-config <path>

Creates a default configuration at the given path. If the given path doesn't exists, it will be created.

$ statful-relay start <path>

Starts the relay with the config on given path.

$ statful-relay start-managed <path>

Starts the relay managed by pm2 with the config on given path.

$ statful-relay stop-managed

Stops the relay managed by pm2.

$ statful-relay restart-managed

Restarts the relay managed by pm2.

$ statful-relay help

Shows a small help for the collector.

Configuration

In the configuration file you can find three main sections: debug, listeners, statfulClient and bunyan.

Debug If enabled, Statful-Relay will expose an Http Server on port 9000 to download heapdumps.

RouteDescriptionType
/heapdumpDownload heapdump.gzip
/memoryShows the memory in usage.string

Listeners

At the moment we only support one kind of listener called statful. However, here are the reference for listeners.

OptionDescriptionTypeDefaultRequired
addressDefines the address where the listener should wait for data.stringnoneYES
ipv6Defines where the address' listener is ipv6.booleannoneYES
portDefine the port where the listener should wait for data.numbernoneYES
statsDefines if the listener's metric stats should be sent.booleannoneYES

Statful Client

OptionDescriptionTypeDefaultRequired
appDefines the application global name. If specified sets a global tag app=setValue.stringnoneNO
defaultObject to set methods options.object{}NO
apiDefined API configurations.objectnoneNO
dryRunDefines if metrics should be output to the logger instead of being send.booleanfalseNO
systemStatsEnables sending metrics with flush stats.booleantrueNO
flushIntervalDefines the periodicity of buffer flushes in miliseconds.number3000NO
flushSizeDefines the maximum buffer size before performing a flush.number1000NO
namespaceDefines the global namespace.stringapplicationNO
sampleRateDefines the rate sampling. Should be a number between 1, 100.number100NO
tagsDefines the global tags.object{}NO
transportDefines the transport layer to be used to send metrics. Valid Transports: udp, apistringnoneYES
hostDefines the host name to where the metrics should be sent. Can also be set inside api.string127.0.0.1NO
pathDefines the api path to where the metrics should be sent. Can also be set inside api.string/tel/v2.0/metricNO
portDefines the port. Can also be set inside api.string2013NO
tokenDefines the token to be used. Must be set inside api.stringnoneNO
timeoutDefines the timeout for the transport layers in miliseconds. Must be set inside api.number2000NO

To get help and information about this specific options please read the Statful Client NodeJS documentation.

Bunyan

OptionDescriptionTypeDefaultRequired
nameDefines the logger name.stringnoneYES
levelDefines the global output level.stringnoneNO
streamsDefine the logger streams. By default, when the value is an empty array, logger will output to proccess.stdout.array[]YES

NOTE: We had only documented some bunyan config fields here but you can set all the supported configs by Bunyan.

Authors

Mindera - Software Craft

License

Statful Collector AWS is available under the MIT license. See the LICENSE file for more information.

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago