{"id":19714687,"url":"https://github.com/quavedev/galaxy-bot","last_synced_at":"2026-05-11T21:39:28.695Z","repository":{"id":47347984,"uuid":"265018726","full_name":"quavedev/galaxy-bot","owner":"quavedev","description":"NodeJS command line tool to monitor and auto-scale Meteor Galaxy","archived":false,"fork":false,"pushed_at":"2023-01-06T06:18:17.000Z","size":1624,"stargazers_count":1,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T14:59:38.744Z","etag":null,"topics":["auto-scaling","galaxy","meteor"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quavedev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-18T17:56:41.000Z","updated_at":"2020-08-26T19:27:27.000Z","dependencies_parsed_at":"2023-02-05T12:30:33.162Z","dependency_job_id":null,"html_url":"https://github.com/quavedev/galaxy-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quavedev%2Fgalaxy-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quavedev%2Fgalaxy-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quavedev%2Fgalaxy-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quavedev%2Fgalaxy-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quavedev","download_url":"https://codeload.github.com/quavedev/galaxy-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241035831,"owners_count":19898082,"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":["auto-scaling","galaxy","meteor"],"created_at":"2024-11-11T22:34:49.852Z","updated_at":"2026-05-11T21:39:23.662Z","avatar_url":"https://github.com/quavedev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Galaxy Bot (galaxy-bot)\nNodeJS command line tool to monitor and auto-scale Meteor [Galaxy](https://www.meteor.com/hosting)\n\n## Disclaimer: galaxy-bot is not ready for use yet but will be soon :)\n\n## Features\n- Monitoring: reads Galaxy metrics\n- Alerts: reports containers and apps not running as expected\n- Auto-scaling: take actions when specific conditions are met\n- Send slack notifications: updates, alerts and autos-scaling messages;\n\n## How it works\nWe use Galaxy public API to read Galaxy dashboards and then we execute actions based on\n your\n desired settings.\n \n## How to use\nSet up in your CI server or equivalent a job to call `galaxy-bot` (galaxy-bot) command\n from\n time to time, it's probably a good idea to use a very short period, like every 2 minutes then\n  you will be always monitoring your containers.\n  \n  If you need help configuring your CI check [our configurations examples](./CI.md). Please open\n   an issue if you are having a hard time then we can improve the documentation. If\n   you have already configured your CI please open a Pull Request including the instructions in the\n    configuration examples.\n  \nFirst you need to install `galaxy-bot` (galaxy-bot) using yarn or npm: \n```\nyarn global add @quave/galaxy-bot\n``` \n```\nnpm install -g @quave/galaxy-bot\n```\n\nThen you run it informing a configuration file with your alerts and auto-scaling rules:\n```\ngalaxy-bot --settings settings.json\n```\nYou can have different settings for different purposes.\n\n\n## Updates\nCheck the [log of changes](./CHANGELOG.md).\n\n## Settings\n\nMost fields are self-explanatory.\n\n- variables\n  - hostname: your app name on Galaxy\n  - seriesName: you can use `5s`, `3m`, `1h` or `1d`\n  - limit: how many metrics do you want to analyze\n\n```json\n{\n  \"galaxyUrl\": \"Galaxy API URL (required)\",\n  \"apiKey\": \"your Galaxy API Key (required)\",\n  \"variables\": {\n    \"hostname\": \"staging.bemarke.com\",\n    \"seriesName\": \"3m\",\n    \"limit\": 5\n  },\n  \"slackWebhook\": \"your Slack webhook URL\",\n  \"silentSlack\": false,\n  \"simulation\": false,  \n  \"infoRules\": {\n    \"send\": true,   \n    \"channel\": \"#galaxy-updates\"\n  },\n  \"alertRules\": {\n    \"channel\": \"#alerts\",\n    \"messagePrefix\": \"@channel\",\n    \"maxInApp\": {\n      \"cpuUsageAverage\": 1,\n      \"memoryUsageByHost\": 1500,\n      \"sessionsByHost\": 5\n    }\n  },\n  \"autoscaleRules\": [{\n    \"channel\": \"#auto-scaling\",\n    \"containersToScale\": 2,\n    \"minContainers\": 2,\n    \"maxContainers\": 10,\n    \"addWhen\": {\n      \"$or\": true,\n      \"cpuPercentageAbove\": 50,\n      \"memoryPercentageAbove\":  70,\n      \"connectionsAbove\":  50\n    },\n    \"reduceWhen\": {\n      \"cpuPercentageBelow\": 25,\n      \"memoryPercentageBelow\": 25,\n      \"connectionsBelow\": 30\n    }\n  }],\n}\n\n```\n\n## Auto scale rules\n\nThe autoscaling (`autoscaleRules`) behavior is meant to adjust smartly the containers on the\n Galaxy server taking\n into account the data got from there and a predefined configuration.\n\n- Three actions are supported:\n  - `add` containers (conditions are configured on `addWhen` json key);\n  - `reduce` containers (conditions are configured on `reduceWhen` json key);\n  - `kill` containers (conditions are configured on `killWhen` json key);\n\n- The conditions available are: \"[cpuPercentage|memoryPercentage|connections][Above|Below]\". Check out to which values refer for each: [from Galaxy Panel](https://user-images.githubusercontent.com/2581993/68477766-26baa380-0226-11ea-81da-c0b635f717d6.png).\n\n- The conditions express the property average on the active containers. The active containers are\n those that are running, the ones starting or stopping are ignored.\n\n- Multiple conditions can be informed and they are evaluated by default as and, it means, all must match to execute the action. You can change this behavior adding `\"$or\": true` to your rule.\n\n- The `addWhen` and `reduceWhen` behaviors check to not go beyond a containers count range. This range is described by the `minContainers` and `maxContainers` configuration. They are required if you are using `addWhen` or `reduceWhen`.\n\n- The `addWhen` and `reduceWhen` behaviors won't run if a scaling is happening. If any other condition passes it will run on the next run.\n\n- The `killWhen` will run if a scaling is happening. If any other condition passes it will run on the next run.\n\n- An slack message is sent anytime a scaling behavior is triggered if you set a Slack Webhook, the\n messages are sent to the default webhook channel. You will receive messages like this\n \n![info](./docs/auto-scaling.png)\n\n## Alerts\nYou can set maximum limits for container metrics (CPU, memory and connected clients).\n\nExample:\n```\n\"alertRules\": {\n    \"maxInApp\": {\n      \"cpu\": 60,\n      \"memory\": 70,\n      \"connections\": 1000\n    }\n},\n```\nYou will receive an alert like this when at least `minimumStats` times in a row the current value\n was above the maximum expected.\n\n![info](./docs/alert.png)\n\n  Then if you run `galaxy-bot` every 2 minutes and use `minimumStatus\n  ` as 5 you will get an alert when your metric is at least 10 minutes above the maximum expected\n  . \n \n `minimumStats` is set in the first level of the settings because maybe we will use this\n  information in\n  the future also for auto-scaling, for now auto-scaling is not considering the `minimumStats`\n   value.\n \n## Info rules\n- Set the channel, by default will go to default webhook channel\n- You will receive messages like this\n\n![info](./docs/info.png)\n\n## Advanced\n### Remote settings\nIf you need to have dynamic settings coming from a external location, like an API, you can\n configure: \n ```json\n\"remote\": {\n    \"url\": \"https://yourapi.com/v1/auto-scaling?yourkey=XXX\u0026anySetting=YYY\"\n}\n```\nThen the JSON returned by this API will be merged (using `lodash.merge`) with your local settings\n. If the request to this URL throws an error then the local settings will be used anyway and a\n `console.error` (`Error getting remote options from ${url}`)\n will be printed.\n\n## LICENSE \n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquavedev%2Fgalaxy-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquavedev%2Fgalaxy-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquavedev%2Fgalaxy-bot/lists"}