codecentric / chaos-monkey-spring-boot

Chaos Monkey for Spring Boot
https://codecentric.github.io/chaos-monkey-spring-boot/
Apache License 2.0
907 stars 170 forks source link

Exclude classes watcher config update is not working via POST watchers actuator endpoint #394

Open bunty-raghani opened 1 year ago

bunty-raghani commented 1 year ago

In case of POST watchers actuator endpoint, when we specify any classes that needs to be excluded, in that case, those classes are not getting updated in watchers config. In this case, POST request will be completed successfully with 200 OK response but when you verify the watchers config using GET watchers endpoint, exclude classes array will appear as empty.

NOTE: Exclude classes functionality is working fine when we specify the same via application.properties chaos.monkey.watcher.exclude-classes=com.example.chaos.monkey.service.UsersService

Expected Behavior

In case of POST watchers actuator endpoint, when we specify any class/classes that needs to be excluded then the watcher config should be updated correctly with specified set of classes.

Current Behavior

Exclude classes config is not getting updated. Exclude classes will always appear as empty in case of GET watchers endpoint.

Steps to Reproduce

  1. Specify a single class/set of classes that needs to be excluded in case of POST watchers endpoint "excludeClasses": ["com.example.chaos.monkey.service.UsersService"]
  2. POST request will be completed with 200 ok response.
  3. Hit GET watchers actuator endpoint, excludeClasses will appear as empty.

Context (Environment)

It will be helpful if we can directly update the exclude classes via actuator endpoint instead of specifying the same in application.properties and restarting the app each and every time.

F43nd1r commented 12 months ago

Configuring excludeClasses via endpoint is not implemented atm. The endpoint just ignores the unknown property

F43nd1r commented 12 months ago

The excludeClasses field is only evaluated at bean creation, making this dynamically configurable might lead to confusion