This is a demo using Chaos Monkey for Spring Boot to demonstrate chaos engineering at the app level.
The provided docker-compose
will start Prometheus and Grafana to observe what's happening when failures and exceptions are injected into the app.
This demo was originally used at GrafanaCon LA 2019, various JUGs and Enterprise demos.
- Docker
- Docker Compose
Docker will start containers for Redis, Prometheus, Grafana, Locust and the 2 Spring Boot applications.
cd script
./start-containers.sh
- Prometheus is running at http://localhost:9090
- Grafana is running at http://localhost:3000
- Locust is running at http://localhost:8089
You need to import manually the dashboard.
Log in to Grafana (admin/admin) and go to Dashboards -> Manage -> Import page. Then upload the JSON file located in the /docker/grafana/dashboards
folder of this project.
The Prometheus Datasource is set up automatically.
Open the Locust Dashboard, add 50 users and click on the Start swarming
button.
./enable-cmsb.sh
curl -X POST \
http://localhost:8081/actuator/chaosmonkey/assaults \
-H 'Content-Type: application/json' \
-d ' {
"level": 10,
"latency_range_start": 2000,
"latency_range_end": 5000,
"latency_active": false,
"exceptions_active": false
}'
Update the code and restart the client
./restart-client.sh
Run the following script to stop and clean up all the containers.
./stop-containers.sh
Thanks to the Open Beer Database for providing a great list of beers.