{"id":18188902,"url":"https://github.com/mlafeldt/chaosmonkey","last_synced_at":"2025-04-02T04:31:49.197Z","repository":{"id":57528103,"uuid":"55183002","full_name":"mlafeldt/chaosmonkey","owner":"mlafeldt","description":"Go client to the Chaos Monkey REST API","archived":false,"fork":false,"pushed_at":"2020-08-20T15:25:11.000Z","size":168,"stargazers_count":57,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T10:23:59.637Z","etag":null,"topics":["aws","chaos-engineering","chaos-monkey","chaos-testing","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlafeldt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-03-31T21:07:01.000Z","updated_at":"2024-02-01T11:29:47.000Z","dependencies_parsed_at":"2022-09-03T22:20:31.833Z","dependency_job_id":null,"html_url":"https://github.com/mlafeldt/chaosmonkey","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlafeldt%2Fchaosmonkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlafeldt%2Fchaosmonkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlafeldt%2Fchaosmonkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlafeldt%2Fchaosmonkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlafeldt","download_url":"https://codeload.github.com/mlafeldt/chaosmonkey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246757511,"owners_count":20828908,"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","chaos-engineering","chaos-monkey","chaos-testing","golang"],"created_at":"2024-11-03T03:05:08.546Z","updated_at":"2025-04-02T04:31:44.188Z","avatar_url":"https://github.com/mlafeldt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chaosmonkey\n\n[![CI](https://github.com/mlafeldt/chaosmonkey/workflows/Go/badge.svg)](https://github.com/mlafeldt/chaosmonkey/actions)\n[![GoDoc](https://godoc.org/github.com/mlafeldt/chaosmonkey/lib?status.svg)](https://godoc.org/github.com/mlafeldt/chaosmonkey/lib)\n\nGo client to the [Chaos Monkey REST API](https://github.com/Netflix/SimianArmy/wiki/REST) that can be used to trigger and retrieve chaos events.\n\nThis project was started for the purpose of controlled failure injection during GameDay events.\n\n## Prerequisites\n\nFirst of all, you need a running [Simian Army](https://github.com/Netflix/SimianArmy) that exposes its REST API via HTTP.\n\nIn order to trigger chaos events via the API, Chaos Monkey must be unleashed and on-demand termination must be enabled via these configuration properties:\n\n```\nsimianarmy.chaos.leashed = false\nsimianarmy.chaos.terminateOndemand.enabled = true\n```\n\nIf you plan to use the REST API only, you should also disable all scheduled terminations:\n\n```\nsimianarmy.chaos.asg.enabled = false\n```\n\n## CLI\n\n### Installation\n\nIf you're on Mac OS X, the easiest way to get the `chaosmonkey` command-line tool is via Homebrew:\n\n```bash\nbrew tap mlafeldt/formulas\nbrew install chaosmonkey\n```\n\nYou can also build the tool from source, provided you have Go installed:\n\n```bash\ngo get -u github.com/mlafeldt/chaosmonkey\n```\n\n### Usage\n\nUse the tool to:\n\n* Trigger a new chaos event:\n\n    ```bash\n    chaosmonkey -endpoint http://example.com:8080 \\\n        -group ExampleAutoScalingGroup -strategy ShutdownInstance\n    ```\n\n* Trigger the same event 5 times at intervals of 10 seconds, with a probability of 20% per event:\n\n    ```bash\n    chaosmonkey -endpoint http://example.com:8080 \\\n        -group ExampleAutoScalingGroup -strategy ShutdownInstance \\\n        -count 5 -interval 10s -probability 0.2\n    ```\n\n    This is useful to terminate more than one EC2 instance of an auto scaling group.\n\n* Get a list of past chaos events:\n\n    ```bash\n    chaosmonkey -endpoint http://example.com:8080\n    ```\n\n* List available chaos strategies, which you may pass to `-strategy`:\n\n    ```bash\n    chaosmonkey -list-strategies\n    ```\n\n* List all auto scaling groups for a given AWS account, which you may then pass to `-group`:\n\n    ```bash\n    export AWS_ACCESS_KEY_ID=...\n    export AWS_SECRET_ACCESS_KEY=...\n    export AWS_REGION=...\n    export AWS_ROLE=...\n    chaosmonkey -list-groups\n    ```\n\n* Wipe state of Chaos Monkey by deleting its SimpleDB domain (named `SIMIAN_ARMY` by default):\n\n    ```bash\n    export AWS_ACCESS_KEY_ID=...\n    export AWS_SECRET_ACCESS_KEY=...\n    export AWS_REGION=...\n    export AWS_ROLE=...\n    chaosmonkey -wipe-state SIMIAN_ARMY\n    ```\n\n    Warning: Requires a restart of Chaos Monkey.\n\nAs always, invoke `chaosmonkey -h` for a list of all available options.\n\nIn addition to command-line options, the tool also understands these environment variables:\n\n* `CHAOSMONKEY_ENDPOINT` - the same as `-endpoint`\n* `CHAOSMONKEY_USERNAME` - the same as `-username`\n* `CHAOSMONKEY_PASSWORD` - the same as `-password`\n\n### Use with Docker\n\n[This Docker image](https://github.com/mlafeldt/docker-simianarmy) allows you to deploy Chaos Monkey with a single command:\n\n```bash\ndocker run -it --rm -p 8080:8080 \\\n    -e SIMIANARMY_CLIENT_AWS_ACCOUNTKEY=$AWS_ACCESS_KEY_ID \\\n    -e SIMIANARMY_CLIENT_AWS_SECRETKEY=$AWS_SECRET_ACCESS_KEY \\\n    -e SIMIANARMY_CLIENT_AWS_REGION=$AWS_REGION \\\n    -e SIMIANARMY_CHAOS_LEASHED=false \\\n    -e SIMIANARMY_CHAOS_ASG_ENABLED=false \\\n    -e SIMIANARMY_CHAOS_TERMINATEONDEMAND_ENABLED=true \\\n    mlafeldt/simianarmy\n```\n\nAfterwards, you can use `chaosmonkey` to talk to the dockerized Chaos Monkey:\n\n```bash\nchaosmonkey -endpoint http://$DOCKER_HOST_IP:8080 ...\n```\n\n## Go library\n\nIn addition to the CLI tool, the project also provides the `chaosmonkey` Go library for use in other Go projects. To install it from source:\n\n```bash\ngo get -u github.com/mlafeldt/chaosmonkey/lib\n```\n\nFor usage and examples, see the [Godoc documentation](https://godoc.org/github.com/mlafeldt/chaosmonkey/lib).\n\n## Further resources\n\n* [Article: Using Chaos Monkey whenever you feel like it](https://medium.com/production-ready/using-chaos-monkey-whenever-you-feel-like-it-e5fe31257a07#.vuftpxmm://medium.com/production-ready/using-chaos-monkey-whenever-you-feel-like-it-e5fe31257a07)\n* [Article: A Little Story about Amazon ECS, systemd, and Chaos Monkey](https://medium.com/production-ready/a-little-story-about-amazon-ecs-systemd-and-chaos-monkey-8bc7d1b5778)\n* [Talk: Chaos Monkey for Fun and Profit](https://mlafeldt.github.io/blog/chaos-monkey-for-fun-and-profit/)\n* [Talk: Embracing Failure in a Container World](https://speakerdeck.com/mlafeldt/embracing-failure-in-a-container-world)\n\n## Author\n\nThis project is being developed by [Mathias Lafeldt](https://twitter.com/mlafeldt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlafeldt%2Fchaosmonkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlafeldt%2Fchaosmonkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlafeldt%2Fchaosmonkey/lists"}