bolshakov / stoplight-admin

A simple administration interface for the stoplight gem.
http://bolshakov.github.io/stoplight-admin
MIT License
18 stars 18 forks source link

Add more details to circuits (threshold, cool off time, etc.) #30

Open dvdoliveira opened 4 years ago

dvdoliveira commented 4 years ago

We just implemented stoplight-admin to manage Stoplight circuit breakers (thanks for creating it!) and noticed that the UI does not show details about each circuit, like threshold values, cool off time, notifiers, etc.

All these configs can be set per circuit with Stoplight but, currently, the only way for anybody to get them is by querying Redis (or any other data store) for each circuit.

We would like to be able to view and also change those configs whenever necessary through the UI.

I'm willing to work to include this feature and can create a PR for it if it's something that the community would also like to use. Please let me know your opinions and if you need more details about it.
It's something that my team needs ASAP so I'm planning to start working on it this week.

bolshakov commented 1 year ago

This is a valid question. However, currently, we don't store this data in Redis and, therefore, cannot display them in the UI. Moreover, nothing stops you from having two circuit breakers with the same name but different other parameters:

light1 = Stoplight('example-zero').with_threshold(1) { 1 / 0 }
light2 = Stoplight('example-zero').with_threshold(2) { 1 / 0 }

In the example above, Stoplight stores only names (example-zero), and the rest of the parameters exist only in the code. So today, displaying such data is not possible.

We would like to be able to view and also change those configs whenever necessary through the UI.

I like this idea and would love to hear opinions and suggestions.

On the other hand, I see drawbacks in storing such parameters in the database, and there are valid questions:

A decent alternative could be configuring circuit breakers using a config file or environment variables. This way, you still don't have to change your code to tune parameters.

If you have any particular use cases, I appreciate it if you can share them. Also consider filing an issue into Stoplight itself https://github.com/bolshakov/stoplight/issues/new