{"id":33179022,"url":"https://github.com/clusterfk/chaos-proxy","last_synced_at":"2025-11-20T21:03:11.934Z","repository":{"id":55065334,"uuid":"187094577","full_name":"clusterfk/chaos-proxy","owner":"clusterfk","description":"ClusterFk Chaos Proxy is an unreliable HTTP proxy you can rely on; a lightweight tool designed for chaos testing of microservices.","archived":false,"fork":false,"pushed_at":"2023-09-08T12:20:32.000Z","size":72,"stargazers_count":94,"open_issues_count":3,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-16T07:24:24.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://clusterfk.it","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clusterfk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-16T20:09:32.000Z","updated_at":"2024-03-31T14:22:31.000Z","dependencies_parsed_at":"2022-08-14T10:50:31.681Z","dependency_job_id":null,"html_url":"https://github.com/clusterfk/chaos-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clusterfk/chaos-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clusterfk%2Fchaos-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clusterfk%2Fchaos-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clusterfk%2Fchaos-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clusterfk%2Fchaos-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clusterfk","download_url":"https://codeload.github.com/clusterfk/chaos-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clusterfk%2Fchaos-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285511775,"owners_count":27184237,"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","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-11-16T03:00:36.817Z","updated_at":"2025-11-20T21:03:11.929Z","avatar_url":"https://github.com/clusterfk.png","language":"Java","funding_links":[],"categories":["容错组件"],"sub_categories":[],"readme":"\u003cimg src=\"https://i.ibb.co/CmyCwp9/Webp-net-resizeimage-7.png\" alt=\"91a16b7b-336f-402f-a78b-d194550da559\" border=\"0\"\u003e\u003c/a\u003e\u003cbr /\u003e\n# ClusterFk Chaos Proxy\n\n[![Build Status](https://travis-ci.org/clusterfk/chaos-proxy.svg?branch=master)](https://travis-ci.org/clusterfk/chaos-proxy) [![Docker Hub Pulls](https://img.shields.io/docker/pulls/andymacdonald/clusterf-chaos-proxy.svg)](https://hub.docker.com/r/andymacdonald/clusterf-chaos-proxy)\n\n**ClusterFk** Chaos Proxy is an unreliable HTTP proxy you can rely on; a lightweight tool designed for chaos testing of microservices. \n\n## Why Would I Need This?\n\nI will let you in on a secret: **everything fails eventually**. Micro-services often communicate with other services via REST and HTTP. \nHow does your micro-service cope when the services it depends on inevitably fail?\n\n## What Do I Do? (TLDR)\n\n* Configure your locally running _service-under-test_ to point to the chaos proxy and configure the chaos proxy to point to your real running _dependent-destination-service_. \n\n* Switch on **ClusterFk** chaos proxy and configure a \"chaos strategy\".\n\n* Watch the world burn :fire: :fire: :fire:\n\n* _(Optional) Do something about it._\n\n\n## Docker Image ##\n\nPull the latest image:\n\n```sh\ndocker pull andymacdonald/clusterf-chaos-proxy\n```\n\nThen follow the steps in [Running](https://github.com/clusterfk/chaos-proxy#running) and [Configuration](https://github.com/clusterfk/chaos-proxy#configuration) to configure the proxy.\n\n## Building ##\n\n* Build project and create a new docker image:\n```sh\nmvn clean package \u0026\u0026 mvn docker:build\n```\n\n## Running ##\n\nFor running **ClusterFk** Chaos Proxy it is recommended you run using [Docker-Compose](https://docs.docker.com/compose/). Define a `docker-compose.yml` file such as the below:\n```yaml\nversion: \"3.7\"\nservices:\n  user-service-chaos-proxy:\n    image: andymacdonald/clusterf-chaos-proxy\n    environment:\n      JAVA_OPTS: \"-Dchaos.strategy=RANDOM_HAVOC -Ddestination.hostProtocolAndPort=http://localhost:8098\"\n    ports:\n      - \"8080:8080\"\n```\n\nThen simply run (where the `docker-compose.yml` file is located):\n\n```sh\ndocker-compose up\n```\n\nThis will allow you to run multiple instances of **ClusterFk** Chaos Proxy - e.g:\n```yaml\nversion: \"3.7\"\nservices:\n  user-service-chaos-proxy:\n    image: andymacdonald/clusterf-chaos-proxy\n    environment:\n      JAVA_OPTS: \"-Dchaos.strategy=RANDOM_HAVOC -Ddestination.hostProtocolAndPort=http://10.0.0.231:8098\"\n    ports:\n      - \"8080:8080\"\n  account-service-chaos-proxy:\n    image: andymacdonald/clusterf-chaos-proxy\n    environment:\n      JAVA_OPTS: \"-Dchaos.strategy=DELAY_RESPONSE -Ddestination.hostProtocolAndPort=http://10.0.1.150:8918\"\n    ports:\n      - \"8081:8080\"\n```\n\n## Running (Without Docker/Docker-Compose) ##\n\n* Create a `config` directory containing your `application.properties` and take note of the directory name.\n\n* Run application - swapping `\u003cLOCATION_OF_CONFIG\u003e` for the directory from the step before:\n```sh\njava -jar clusterf-chaos-proxy.jar -Dspring.config.location=\u003cLOCATION_OF_CONFIG\u003e/config/application.properties\n```\n\n## Configuration ##\n\nSpecify the port you would like to run **clusterfk** chaos proxy on:\n\n```properties\nserver.port=8080 #8080 is the default\n```\n\nUse this information to configure your _service-under-test_ with relevant config for **ClusterFk** chaos proxy in place of your _dependent-destination-service_.\n\n### Example ###\n\n**Configure Chaos Proxy**\n\nWithin **ClusterFk** chaos proxy, specify `application.properties` or `JAVA_OPTS` to point to your real destination service - e.g.:\n\n```properties\ndestination.hostProtocolAndPort=http://10.0.1.150:9898\n```\n\n**Chaos Strategies**\n\nSpecify your chaos strategy:\n\n\u003cpre\u003e\u003ccode\u003e\u003cb\u003eNO_CHAOS\u003c/b\u003e - Request is simply passed through\n\n\u003cb\u003eDELAY_RESPONSE\u003c/b\u003e - Requests are delayed but successful (configurable delay)\n\n\u003cb\u003eINTERNAL_SERVER_ERROR\u003c/b\u003e - Requests return with 500 INTERNAL SERVER ERROR\n\n\u003cb\u003eBAD_REQUEST\u003c/b\u003e - Requests return with 400 BAD REQUEST\n\n\u003cb\u003eRANDOM_HAVOC\u003c/b\u003e - Requests generally succeed, but randomly fail with random HTTP status codes and random delays\n\u003c/code\u003e\u003c/pre\u003e\n\nWithin your `application.properties` or `JAVA_OPTS`:\n\n```properties\nchaos.strategy=DELAY_RESPONSE\n```\n**Delay Properties**\n\nIf you are specifying a delayed response - you can customise the behaviour of the delay with the following properties:\n\n```properties\nchaos.strategy.delayResponse.fixedPeriod=true       # if number of seconds to delay is constant or random (default is false)\nchaos.tracing.headers=false                         # If this is set to true then 2 headers will be added to the request, \n                                                     'x-clusterfk-delayed-by' and 'x-clusterfk-status-code'.\nchaos.strategy.delayResponse.seconds=60             # if fixed-period delay - number of seconds to delay each requests\nchaos.strategy.delayResponse.random.maxSeconds=120  # if delay is random - maximum amount of time a request can last\n```\n\n**Configure Service Under Test**\n\nFor example, you might configure your _service-under-test_ to point to a user service which has been _\"clusterfk'd\"_.\nIf you configure your _service-under-test_ with properties files, they might change like so:\n\n```properties\nuser-service.baseUrl=http://10.0.1.150:9898/user-service\n```\nTo:\n```properties\nuser-service.baseUrl=http://localhost:8080/user-service\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclusterfk%2Fchaos-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclusterfk%2Fchaos-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclusterfk%2Fchaos-proxy/lists"}