New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

statful-aws-collector

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statful-aws-collector

AWS Cloudwatch collector for Statful

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Statful AWS Collector

[![NPM version][npm-image]][npm-url] Build Status

Staful AWS Collector built in NodeJS. This is intended to collect metrics from AWS CloudWatch and send them to Statful.

Table of Contents

Supported NodeJS Versions

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

Installation

$ npm install -g statful-aws-collector

Quick start

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

$ statful-aws-collector generate-config /etc/statful-aws-collector/conf/

# Update some info in the statful-aws-collector-conf.json: accessKeyId, secretAccessKey and the statful api token

$ statful-aws-collector start /etc/statful-aws-collector/conf/statful-aws-collector-conf.json

Examples

You can find here some useful usage examples of the Statful AWS Collector. In the following examples are assumed you have already installed the collector globally and followed the Quick Start.

Collect a list of metrics

{
  "statfulAwsCollector": {
    ... ,
    "period": 60,
    "statistics": ["SampleCount", "Average", "Sum", "Minimum", "Maximum"],
    "metricsList": {
      "type": "white",
      "metricsPerRegion": {
        "us-west-2": [
          {
            "Namespace": "AWS/ELB"
          },
          {
            "Namespace": "AWS/AutoScaling",
            "MetricName": "GroupMinSize"
          },
          {
            "Namespace": "AWS/AutoScaling",
            "MetricName": "GroupMaxSize"
          },
          {
            "Namespace": "AWS/AutoScaling",
            "MetricName": "GroupStandbyInstances"
          }
        ]
      }
    },
    ...
  },
  ...
}

Collect a metric with different dimensions

{
  "statfulAwsCollector": {
    ... ,
    "period": 60,
    "statistics": ["SampleCount", "Average", "Sum", "Minimum", "Maximum"],
    "metricsList": {
      "type": "white",
      "metricsPerRegion": {
        "us-west-2": [
          {
            "Namespace": "AWS/ELB"
          },
          {
            "Namespace": "AWS/Billing",
            "MetricName": "EstimatedCharges",
            "Dimensions": [
            	{
            		"Name": "ServiceName",
            		"Value": "Service1"
            	},
            	{
            		"Name": "ServiceName",
            		"Value": "Service12"
            	},
            	{
            		"Name": "Currency",
            		"Value": "USD"
            	},
            	{
            		"Name": "Currency",
            		"Value": "EUR"
            	}
            ]
          }
        ]
      }
    },
    ...
  },
  ...
}

Collect metrics from more than one region

{
  "statfulAwsCollector": {
    ... ,
    "period": 300,
    "statistics": ["SampleCount", "Average", "Sum", "Minimum", "Maximum"],
    "metricsList": {
      "type": "white",
      "metricsPerRegion": {
      	"eu-central-1": [
          {
            "Namespace": "AWS/Billing"
          }
        ],
      	"us-west-1": [
          {
            "Namespace": "AWS/Billing"
          }
        ],
        "us-west-2": [
          {
            "Namespace": "AWS/Billing"
          }
        ]
      }
    },
    ...
  },
  ...
}

Reference

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

CLI

$ statful-aws-collector generate-config <path>

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

$ statful-aws-collector start <path>

Starts the collector with the config on given path.

$ statful-aws-collector help

Shows a small help for the collector.

Configuration

In the configuration file you can find 3 main sections: statfulAwsCollector, bunyan, statfulClient.

StatfulAWSCollector

OptionDescriptionTypeDefaultRequired
credentialsDefines the credentials to access AWS.objectnoneYES
periodDefines the global output level.

Valid Periods: 60, 120, 180, 300
number60YES
statisticsDefine the statistcs for which data should be collected.

Valid Statistics: SampleCount, Average, Sum, Minimum, Maximum
array["SampleCount", "Average", "Sum", "Minimum", "Maximum"]YES
metricsListDefines metrics to collect from AWS. Here you should only configure the metricsPerRegion which is an object organized by AWS region. Inside each region you should set a list of metrics object to collect. Each metric object supports a Namespace, MetricName and Dimensions.
Please check the AWS documentation (AWS Metric Reference and Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference) and the Examples section to get more information about the metrics object.
objectnoneYES
signalsDefines the proccess signals for which collector should be stopped. Any valid NodeJS signal can be added.array["SIGTERM", "SIGINT", "SIGABRT", "SIGUSR2"]YES

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.

To get more information please read the Bunyan documentation.

StatfulClient

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
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, api
stringnoneYES
hostDefines the host name to where the metrics should be sent. Can also be set inside api.string127.0.0.1NO
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 more information please read the Statful Client NodeJS documentation.

Authors

Mindera - Software Craft

License

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

Keywords

FAQs

Package last updated on 26 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc