chaos-proxy

command module
v0.0.0-...-9290a63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

README

chaos-proxy

Go Report Card GitHub release Github all releases GPLv3 license Maintenance HitCount Generic badge

What is it?

Chaos-proxy acts almost as a normal proxy. It causes at random, normal http request error scenarios. 500's errors, timeout delays and connections drop.

But why?

I use it to test microservices resilience. If it works fine with chaos-proxy in the middle, it will certainly work without it.

Bind address

Default bind address and port: 0.0.0.0:6667. It can be changed setting CHAOSPROXY_BINDADDR environment variable.

Config file

chaos-proxy.json can be placed into project directory or, preferably, in /etc/chaos-proxy

  • max_timeout: Sets the top boundary for random milliseconds to timeout the request.
  • default_host: Where every request that does not match one of paths will be routed to.
  • paths: Where to route specific requests. If path ends with / it's interpreted as "begins with".
{
	"max_timeout": 5000,
	"default_host": {
		"host": "http://localhost:6666"
	},
	"paths": {
		"/badservice/status/400": {
			"host": "http://localhost:6666"
		},
		"/badservice/status/403": {
			"host": "http://localhost:6666"
		},
		"/badservice/status/404": {
			"host": "http://localhost:6666"
		},
		"/data/2.5/": {
			"host": "http://api.openweathermap.org:80"
		}
	}
}

Status

Chaos-proxy is still in a very early stage. The "random error" generator is pretty lousy and there's code that can be improved for sure. But, as is, it works as intended.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL