{"id":20980694,"url":"https://github.com/statful/statful-relay","last_synced_at":"2025-07-02T09:04:36.867Z","repository":{"id":12440119,"uuid":"71812622","full_name":"statful/statful-relay","owner":"statful","description":"In-premise Relay for Statful","archived":false,"fork":false,"pushed_at":"2023-03-04T02:49:16.000Z","size":1035,"stargazers_count":3,"open_issues_count":9,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T08:43:55.564Z","etag":null,"topics":["relay","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-24T17:12:53.000Z","updated_at":"2021-03-31T08:36:46.000Z","dependencies_parsed_at":"2024-11-19T05:47:33.708Z","dependency_job_id":null,"html_url":"https://github.com/statful/statful-relay","commit_stats":{"total_commits":166,"total_committers":13,"mean_commits":12.76923076923077,"dds":0.6807228915662651,"last_synced_commit":"6182d8f37bd82275971efb58784c8b93d299b4b0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/statful/statful-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statful","download_url":"https://codeload.github.com/statful/statful-relay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-relay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263108807,"owners_count":23415005,"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":["relay","statful"],"created_at":"2024-11-19T05:29:39.572Z","updated_at":"2025-07-02T09:04:36.842Z","avatar_url":"https://github.com/statful.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Statful Relay\n=============\n[npm-url]: https://npmjs.org/package/statful-relay\n[npm-image]: https://badge.fury.io/js/statful-relay.svg\n\n[![NPM version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/statful/statful-relay.svg?branch=master)](https://travis-ci.org/statful/statful-relay)\n\nStaful Relay built in NodeJS. This is intended to gather metrics from different sources inside the same network and relays it to a centralized system.\n\n## Table of Contents\n\n* [Supported NodeJS Versions](#supported-nodejs-versions)\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [Examples](#examples)\n* [Reference](#reference)\n* [Authors](#authors)\n* [License](#license)\n\n## Supported NodeJS Versions\n\n| Statful Collector AWS Version | Tested NodeJS versions  |\n|:---|:---|\n| 1.x.x | `4` and `Stable` |\n\n## Installation\n\n```bash\n$ npm install -g statful-relay\n```\n\n## Quick start\n\nAfter installing Statful Relay you are ready to use it. The quickest way is to do the following:\n\n```bash\n$ statful-relay generate-config /etc/statful-relay/conf/\n\n# Update some info in the statful-relay-conf.json: statful api token\n\n$ statful-relay start /etc/statful-relay/conf/statful-relay-conf.json\n```\n\n## Examples\n\nYou 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](#quick-start).\n\n### Use a listener for statful metrics and sends them to the public api\n\n```json\n{\n  \"debug\": false,\n  \"listeners\": {\n    \"statful\": {\n      \"port\": 2013,\n      \"address\": \"127.0.0.1\",\n      \"ipv6\": false,\n      \"stats\": false\n    }\n  },\n  \"statfulClient\": {\n    \"app\": \"statful-relay\",\n    \"tags\": {\n       \"env\": \"readme\",\n    },\n    \"transport\": \"api\",\n    \"api\": {\n      \"token\": \"STATFUL_API_TOKEN\",\n      \"timeout\": 2000,\n      \"host\": \"api.statful.com\", // Default value\n      \"port\": 443 // Default value\n    },\n    \"flushSize\": 1000,\n    \"flushInterval\": 3000,\n    \"systemStats\": false\n  },\n  \"bunyan\": {\n    \"name\": \"stdout\",\n    \"streams\": []\n  }\n}\n```\n\n## Reference\n\nDetailed reference if you want to take full advantage from Statful Relay.\n\n### CLI\n\n```bash\n$ statful-relay generate-config \u003cpath\u003e\n```\n\nCreates a default configuration at the given path. If the given path doesn't exists, it will be created.\n\n```bash\n$ statful-relay start \u003cpath\u003e\n```\n\nStarts the relay with the config on given path.\n\n```bash\n$ statful-relay start-managed \u003cpath\u003e\n```\n\nStarts the relay managed by pm2 with the config on given path.\n\n```bash\n$ statful-relay stop-managed\n```\n\nStops the relay managed by pm2.\n\n```bash\n$ statful-relay restart-managed\n```\n\nRestarts the relay managed by pm2.\n\n```bash\n$ statful-relay help\n```\n\nShows a small help for the collector.\n\n### Configuration\n\nIn the configuration file you can find three main sections: `debug, listeners, statfulClient and bunyan`.\n\n**Debug**\nIf enabled, Statful-Relay will expose an Http Server on port 9000 to download heapdumps and show the memory in usage.\n\n| Route | Description | Type |\n|:---|:---|:---|\n| /heapdump | Download heapdump. | `gzip` |\n| /memory | Shows the memory in usage. | `string` |\n\n\n**Listeners**\n\nAt the moment we only support one kind of listener called `statful`. However, here are the reference for listeners.\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| _address_ | Defines the address where the listener should wait for data. | `string` | **none** | **YES** |\n| _ipv6_ | Defines where the address' listener is ipv6. | `boolean` | **none** | **YES** |\n| _port_ | Define the port where the listener should wait for data. | `number` | **none** | **YES** |\n| _stats_ |  Defines if the listener's metric stats should be sent. | `boolean` | **none** | **YES** |\n\n**Statful Client**\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| _app_ | Defines the application global name. If specified sets a global tag `app=setValue`. | `string` | **none** | **NO** |\n| _default_ | Object to set methods options. | `object` | `{}` | **NO** |\n| _api_ | Defined API configurations. | `object` | **none** | **NO** |\n| _dryRun_ | Defines if metrics should be output to the logger instead of being send. | `boolean` | `false` | **NO** |\n| _systemStats_ | Enables sending metrics with flush stats. | `boolean` | `true` | **NO** |\n| _flushInterval_ | Defines the periodicity of buffer flushes in **miliseconds**. | `number` | `3000` | **NO** |\n| _flushSize_ | Defines the maximum buffer size before performing a flush. | `number` | `1000` | **NO** |\n| _namespace_ | Defines the global namespace. | `string` | `application` | **NO** |\n| _sampleRate_ | Defines the rate sampling. **Should be a number between [1, 100]**. | `number` | `100` | **NO** |\n| _tags_ | Defines the global tags. | `object` | `{}` | **NO** |\n| _transport_ | Defines the transport layer to be used to send metrics.\u003cbr\u003e\u003cbr\u003e **Valid Transports:** `udp, api` | `string` | **none** | **YES** |\n| _host_ | Defines the host name to where the metrics should be sent. Can also be set inside _api_. | `string` | `127.0.0.1` | **NO** |\n| _path_ | Defines the api path to where the metrics should be sent. Can also be set inside _api_. | `string` | `/tel/v2.0/metric` | **NO** |\n| _port_ | Defines the port. Can also be set inside _api_. | `string` | `2013` | **NO** |\n| _token_ | Defines the token to be used.  Must be set inside _api_. | `string` | **none** | **NO** |\n| _timeout_ | Defines the timeout for the transport layers in **miliseconds**. Must be set inside _api_. | `number` | `2000` | **NO** |\n\nTo get help and information about this specific options please read the [Statful Client NodeJS documentation](https://github.com/statful/statful-client-nodejs).\n\n**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, logger will output to `proccess.stdout`. | `array` | `[]` | **YES** |\n\n\u003e **NOTE:** We had only documented some bunyan config fields here but you can set all the supported configs by Bunyan.\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-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatful%2Fstatful-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-relay/lists"}