https://github.com/chaos-php/chaos-monkey-symfony-bundle
Chaos Monkey for Symfony applications. Try to attack your running Symfony App.
https://github.com/chaos-php/chaos-monkey-symfony-bundle
chaos-engineering chaos-monkey php quality-assurance symfony symfony-bundle
Last synced: 2 months ago
JSON representation
Chaos Monkey for Symfony applications. Try to attack your running Symfony App.
- Host: GitHub
- URL: https://github.com/chaos-php/chaos-monkey-symfony-bundle
- Owner: chaos-php
- License: mit
- Created: 2020-12-23T14:09:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-02T08:26:09.000Z (almost 2 years ago)
- Last Synced: 2025-08-27T07:45:53.867Z (7 months ago)
- Topics: chaos-engineering, chaos-monkey, php, quality-assurance, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 122 KB
- Stars: 86
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChaosMonkeySymfonyBundle
[](https://php.net/)

[](https://packagist.org/packages/chaos-php/chaos-monkey-symfony-bundle)
[](https://github.com/chaos-php/chaos-monkey-symfony-bundle/actions/workflows/ci.yml)

Chaos Monkey for Symfony applications. Try to attack your running Symfony App.
## Assaults
- **Latency Assault** - adds a delay randomly from the range (min and max)
- **Exception Assault** - throws given exception class
- **Memory Assault** - fill memory until target fraction (95% for example)
- **Kill Assault** - no mercy, plain `exit()`
## Watchers
- **Request** - attack http request
- Repository (not implemented)
- Service (not implemented)
## Activators
- "Query param" - attack only if given query param is present (default `chaos`)
## Symfony
## How to use
1. Install with composer:
```bash
composer require chaos-php/chaos-monkey-symfony-bundle
```
2. Add Symfony bundle (e.g. `config/bundles.php`):
```php
return [
//... other bundles
Chaos\Monkey\Symfony\ChaosMonkeyBundle::class => ['all' => true],
];
```
3. Add `chaos_monkey.yaml` configuration (copy from below) and enable assaults
4. Watch your app plunge into chaos 🙈🙊🙉 😈
## Configuration reference
```yml
chaos_monkey:
enabled: false
probability: 20 # percentage probability of attack (100 - everyone, 0 - none)
assaults:
latency:
active: false
minimum: 1000 # in miliseconds
maximum: 3000 # in miliseconds
memory:
active: false
fill_fraction: 0.95 # percentage of memory filling
exception:
active: false
class: 'RuntimeException'
kill_app:
active: false
watchers: # currently watchers can be enabled/disabled only in container compile time
request:
enabled: true
priority: 0
activators:
query_param: false # if true then chaos monkey will be called only if given query param exist (with any value)
query_param_name: 'chaos'
```
## Roadmap
- [ ] Flex recipe
- [ ] Metrics (for example `chaos_monkey_request_count_assaulted`)
- [ ] Assault profiles - each profile can contain different assaults
- [ ] CustomWatcher (based on container tag)
- [ ] CustomAssault (not implemented)
## License
ChaosMonkeySymfonyBundle is released under the MIT Licence. See the bundled LICENSE file for details.
## Author
Arkadiusz Kondas (@ArkadiuszKondas)