{"id":20980701,"url":"https://github.com/statful/statful-collector-aws","last_synced_at":"2025-05-14T15:30:51.305Z","repository":{"id":11317290,"uuid":"69243891","full_name":"statful/statful-collector-aws","owner":"statful","description":"NodeJS agent to collect metrics from AWS CloudWatch into Statful.","archived":false,"fork":false,"pushed_at":"2022-12-02T20:21:59.000Z","size":2195,"stargazers_count":5,"open_issues_count":10,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T08:44:49.338Z","etag":null,"topics":["aws","aws-cloudwatch","collector","metrics","statful"],"latest_commit_sha":null,"homepage":"https://www.statful.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-26T11:34:33.000Z","updated_at":"2021-03-31T09:48:14.000Z","dependencies_parsed_at":"2023-01-13T16:27:12.916Z","dependency_job_id":null,"html_url":"https://github.com/statful/statful-collector-aws","commit_stats":null,"previous_names":["statful/statful-aws-collector"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-collector-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-collector-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-collector-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-collector-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statful","download_url":"https://codeload.github.com/statful/statful-collector-aws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171603,"owners_count":22026471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cloudwatch","collector","metrics","statful"],"created_at":"2024-11-19T05:29:42.873Z","updated_at":"2025-05-14T15:30:49.998Z","avatar_url":"https://github.com/statful.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nStatful Collector AWS\n==============\n[npm-url]: https://npmjs.org/package/statful-collector-aws\n[npm-image]: https://badge.fury.io/js/statful-collector-aws.svg\n\n[![NPM version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/statful/statful-collector-aws.svg?branch=master)](https://travis-ci.org/statful/statful-collector-aws)\n\nStaful Collector AWS is built in NodeJS. This collector is intended to gather metrics from *AWS CloudWatch* and send them to Statful.\n\n## Table of Contents\n\n* [Supported NodeJS Versions](#supported-nodejs-versions)\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [Reference](#reference)\n\t* [CLI](#cli)\n\t* [Configuration File](#configuration-file) \n* [Examples](#examples)\n\t* [Collect a List of Metrics](#collect-a-list-of-metrics)\n\t* [Collect a Metric with Different Dimensions](#collect-a-metric-with-different-dimensions)\n\t* [Collect Metrics from Multiple Regions](#collect-metrics-from-multiple-regions )\n* [Authors](#authors)\n* [License](#license)\n\n## Supported NodeJS Versions\n\n| Statful Collector AWS Version | Tested NodeJS versions  |\n|:---|:---|\n| 1.1.x | `4` |\n| 1.2.x | `6.9.2`, `10.9.0` and `Stable` |\n\n## Installation\n\n```bash\n$ npm install -g statful-collector-aws\n```\n\n## Quick Start\n\nAfter installing Statful Collector AWS, you are ready to start using it. You can use it straight away by doing:\n\n```bash\n$ statful-collector-aws generate-config /etc/statful-collector-aws/conf/\n\n# Update the access details in the statful-collector-aws-conf.json: accessKeyId, secretAccessKey, and the Statful's API token\n\n$ statful-collector-aws start /etc/statful-collector-aws/conf/statful-collector-aws-conf.json\n```\n\n\n## Reference\n\nThe following section presents a detailed reference of the available options to take full advantage from the Statful Collector AWS.\n\n### CLI\nHere we provide a set of instructions to get started with calls to the service/collector. These refer to the AWS Command Line Interface [syntax](https://aws.amazon.com/cli/).\n\u003cbr\u003e\n\nCreate a default configuration at the given path. If the given path doesn't exist, it is created based on the user’s input. \n```bash\n$ statful-collector-aws generate-config \u003cpath\u003e\n```\n\nStart the collector with the existing configuration on the given path.\n```bash\n$ statful-collector-aws start \u003cpath\u003e\n```\n\nStart the collector managed by PM2 with the existing configuration on the given path.\n```bash\n$ statful-collector-aws start-managed \u003cpath\u003e\n```\n\nStop the collector managed by PM2.\n```bash\n$ statful-collector-aws stop-managed\n```\n\nRestart the collector managed by PM2.\n```bash\n$ statful-collector-aws restart-managed\n```\n\nDisplay a help screen listing built-in commands, each with a brief description.\n```bash\n$ statful-collector-aws help\n```\n\n\n### Configuration File\n\nIn the configuration file, you will find three distinct sections: `statfulCollectorAws`, `bunyan`, `statfulClient`. Here we identify the options that define them.\n\n**StatfulCollectorAWS**\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| _credentials_ | Defines the credentials required to access AWS. | `object` | **none** | **YES** |\n| _period_ | Defines the global output level, in **seconds**.\u003cbr\u003e\u003cbr\u003e **Valid Periods:** `60, 120, 180, 300` | `number` | 60 | **YES** |\n| _statistics_ | Defines which statistics data should be collected from AWS.\u003cbr\u003e\u003cbr\u003e **Valid Statistics:** `SampleCount, Average, Sum, Minimum, Maximum` | `array` | `[\"SampleCount\", \"Average\", \"Sum\", \"Minimum\", \"Maximum\"]` | **YES** |\n| _metricsList_ | Defines 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`.| `object` | **none** | **YES** |\n| _signals_ | Defines the process signals for which the collector should be stopped. You can add any valid NodeJS signal. | `array` | `[\"SIGTERM\", \"SIGINT\", \"SIGABRT\", \"SIGUSR2\"]` | **YES** |\n\u003eTo get more information about the metrics object, or related to AWS entities, please refer to the AWS documentation ([AWS Metric Reference](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html) and [Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html)) and our [Examples](https://github.com/statful/statful-collector-aws/blob/master/README.md#examples) section.\n\n**Bunyan**\n\nNext, you will only find the description to some of the Bunyan configuration options, but you can use all of the supported configurations by Bunyan.\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| _name_ | Defines the logger name. | `string` | **none** | **YES** |\n| _level_ | Defines the global output level. | `string` | **none** | **NO** |\n| _streams_ | Define the logger streams. By default, when the value is an empty array, the logger will output to `process.stdout`. | `array` | `[]` | **YES** |\n\n\u003e To get more information, please read the [Bunyan documentation](https://github.com/trentm/node-bunyan).\n\n**StatfulClient**\n\nFind more information about this specific client on the [Statful Client NodeJS documentation](https://github.com/statful/statful-client-nodejs).\n\n\n\n## Examples\n\nHere you can find some useful usage examples of the Statful Collector AWS. In the following examples, we assume that you have already installed the collector with success and followed through the [Quick Start](#quick-start).\n\n### Collect a List of Metrics\n\nCollect the metrics that you want from the full possible list of metrics received from AWS. Please check the StatfulCollectorAWS [reference](https://github.com/statful/statful-collector-aws#configuration) for more details.\n\n```json\n{\n  \"statfulCollectorAws\": {\n    ... ,\n    \"period\": 60,\n    \"statistics\": [\"SampleCount\", \"Average\", \"Sum\", \"Minimum\", \"Maximum\"],\n    \"metricsList\": {\n      \"type\": \"white\",\n      \"metricsPerRegion\": {\n        \"us-west-2\": [\n          {\n            \"Namespace\": \"AWS/ELB\"\n          },\n          {\n            \"Namespace\": \"AWS/AutoScaling\",\n            \"MetricName\": \"GroupMinSize\"\n          },\n          {\n            \"Namespace\": \"AWS/AutoScaling\",\n            \"MetricName\": \"GroupMaxSize\"\n          },\n          {\n            \"Namespace\": \"AWS/AutoScaling\",\n            \"MetricName\": \"GroupStandbyInstances\"\n          }\n        ]\n      }\n    },\n    ...\n  },\n  ...\n}\n```\n\n### Collect a Metric with Different Dimensions\n\nA dimension, as read in the AWS [docs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension), is a name/value pair that uniquely identifies a metric. You can specify a maximum of 10 dimensions for a given metric. Here’s an example on collecting a metric with a set of dimensions:\n\n```json\n{\n  \"statfulCollectorAws\": {\n    ... ,\n    \"period\": 60,\n    \"statistics\": [\"SampleCount\", \"Average\", \"Sum\", \"Minimum\", \"Maximum\"],\n    \"metricsList\": {\n      \"type\": \"white\",\n      \"metricsPerRegion\": {\n        \"us-west-2\": [\n          {\n            \"Namespace\": \"AWS/ELB\"\n          },\n          {\n            \"Namespace\": \"AWS/Billing\",\n            \"MetricName\": \"EstimatedCharges\",\n            \"Dimensions\": [\n            \t{\n            \t\t\"Name\": \"ServiceName\",\n            \t\t\"Value\": \"Service1\"\n            \t},\n            \t{\n            \t\t\"Name\": \"ServiceName\",\n            \t\t\"Value\": \"Service12\"\n            \t},\n            \t{\n            \t\t\"Name\": \"Currency\",\n            \t\t\"Value\": \"USD\"\n            \t},\n            \t{\n            \t\t\"Name\": \"Currency\",\n            \t\t\"Value\": \"EUR\"\n            \t}\n            ]\n          }\n        ]\n      }\n    },\n    ...\n  },\n  ...\n}\n```\n\n### Collect Metrics from Multiple Regions\n\nMost of the Amazon Web Services offer a regional endpoint to make your requests. The full list of available regions is presented [here](https://docs.aws.amazon.com/general/latest/gr/rande.html). Statful also allows you to collect metrics from multiple regions - check the example below.\n\n```json\n{\n  \"statfulCollectorAws\": {\n    ... ,\n    \"period\": 300,\n    \"statistics\": [\"SampleCount\", \"Average\", \"Sum\", \"Minimum\", \"Maximum\"],\n    \"metricsList\": {\n      \"type\": \"white\",\n      \"metricsPerRegion\": {\n      \t\"eu-central-1\": [\n          {\n            \"Namespace\": \"AWS/Billing\"\n          }\n        ],\n      \t\"us-west-1\": [\n          {\n            \"Namespace\": \"AWS/Billing\"\n          }\n        ],\n        \"us-west-2\": [\n          {\n            \"Namespace\": \"AWS/Billing\"\n          }\n        ]\n      }\n    },\n    ...\n  },\n  ...\n}\n```\n\n## Authors\n\n[Mindera - Software Craft](https://github.com/Mindera)\n\n## License\n\nStatful Collector AWS is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/statful/statful-collector-aws/master/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-collector-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatful%2Fstatful-collector-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-collector-aws/lists"}