{"id":15178420,"url":"https://github.com/grafana/xk6-chaos","last_synced_at":"2025-10-01T18:32:20.845Z","repository":{"id":40298569,"uuid":"316444613","full_name":"grafana/xk6-chaos","owner":"grafana","description":"xk6 extension for running chaos experiments with k6 💣","archived":true,"fork":false,"pushed_at":"2022-11-09T13:34:10.000Z","size":184,"stargazers_count":22,"open_issues_count":1,"forks_count":7,"subscribers_count":148,"default_branch":"main","last_synced_at":"2024-11-14T22:36:05.445Z","etag":null,"topics":["chaos","chaos-engineering","k6-extension","reliability","sre","testing","xk6"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.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":"2020-11-27T08:36:10.000Z","updated_at":"2024-03-23T16:29:38.000Z","dependencies_parsed_at":"2022-08-28T08:20:16.891Z","dependency_job_id":null,"html_url":"https://github.com/grafana/xk6-chaos","commit_stats":null,"previous_names":["simskij/k6-extension-chaos","simskij/xk6-chaos","k6io/xk6-chaos"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-chaos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-chaos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-chaos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-chaos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/xk6-chaos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234892715,"owners_count":18902907,"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":["chaos","chaos-engineering","k6-extension","reliability","sre","testing","xk6"],"created_at":"2024-09-27T15:02:41.722Z","updated_at":"2025-10-01T18:32:15.586Z","avatar_url":"https://github.com/grafana.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n\u003e ## Deprecation notice\n\u003e ⚠️ k6-chaos has been deprecated in favor or [xk6-disruptor](https://github.com/grafana/xk6-disruptor) a k6 extension providing fault injection capabilities.\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![logo](assets/logo.png)\n\n# xk6-chaos\nA k6 extension for testing for the unknown unknowns.\nBuilt for [k6](https://go.k6.io/k6) using [xk6](https://github.com/grafana/xk6).\n\n\u003c/div\u003e\n\n## Build\n\nTo build a `k6` binary with this extension, first ensure you have the prerequisites:\n\n- [Go toolchain](https://go101.org/article/go-toolchain.html)\n- Git\n\nThen:\n\n1. Download `xk6`:\n  ```bash\n  $ go install go.k6.io/xk6/cmd/xk6@latest\n  ```\n\n2. Build the binary:\n  ```bash\n  $ xk6 build --with github.com/grafana/xk6-chaos@latest\n  ```\n\n## Example\n\n```javascript\nimport chaos from 'k6/x/chaos';\nimport { Pods } from 'k6/x/chaos/k8s';\n\nexport default function () {\n  console.log(`Running grafana/xk6-chaos@${chaos.version}.`);\n  const p = new Pods();\n  console.log(\n    `There are currently ${p.list().length} pods in the default namespace.`\n  );\n  killPod(p);\n  console.log(\n    `There are now ${p.list().length} pods in the default namespace.`\n  );\n}\n\nfunction killPod(p) {\n  const victim = p.list()[0];\n  console.log(`Killing pod ${victim}`);\n  p.killByName('default', victim);\n}\n```\n\nResult output:\n\n```bash\n$ ./k6 run script.js\n\n          /\\      |‾‾| /‾‾/   /‾‾/   \n     /\\  /  \\     |  |/  /   /  /    \n    /  \\/    \\    |     (   /   ‾‾\\  \n   /          \\   |  |\\  \\ |  (‾)  | \n  / __________ \\  |__| \\__\\ \\_____/ .io\n\n  execution: local\n     script: test.js\n     output: -\n\n  scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):\n           * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)\n\nINFO[0000] Running grafana/xk6-chaos@v0.0.1.             source=console\nINFO[0000] There are currently 33 pods in the default namespace.  source=console\nINFO[0000] Killing pod chaos-webserver-54bd848884-ds2g9           source=console\nINFO[0000] There are now 32 pods in the default namespace.        source=console\n\nrunning (00m00.1s), 0/1 VUs, 1 complete and 0 interrupted iterations\ndefault ✓ [======================================] 1 VUs  00m00.1s/10m0s  1/1 iters, 1 per VU\n\n    data_received........: 0 B 0 B/s\n    data_sent............: 0 B 0 B/s\n    iteration_duration...: avg=111.72ms min=111.72ms med=111.72ms max=111.72ms p(90)=111.72ms p(95)=111.72ms\n    iterations...........: 1   7.513995/s\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-chaos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fxk6-chaos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-chaos/lists"}