-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds config reload handler #222
base: master
Are you sure you want to change the base?
Conversation
444eeb1
to
d78085e
Compare
@Knappek What do you think about this enhancement. Can you please have a look and give me your input. Thanks! |
@amimof sorry for the late reply. I like the idea! Unfortunately it does not yet work as expected as you are only returning the content of the config file. You have to reset the service to actually use the new config file. |
Right, I'll make sure to have somthing working as soon as possible. Thanks! |
@Knappek I've managed to get the reload handler to reload the services. Also added a test that verifies it. Have a look and tell me what you think. |
@amimof looks really good already, just some minor comments. Awesome new feature 👍 |
Return 500 if config reload fails
* Added function `setupServices()` which is called on app startup and when `POST /reload` is called * Services are now correctly reloaded * Added `ReloadRoutes` in transport package which adds new routes on an exiting echo server
c055d47
to
e404e7b
Compare
@Knappek Please review |
Hi, Any news for this feature ? You need some help for that ? Regards |
@hokagegano Just needs approval from @Knappek |
As of #254 I'm not actively contributing anymore. Please reach out to owners of this project. Thank you! |
func ReloadRoutes(e *echo.Echo, routes []Route, logger log.Logger) { | ||
for _, r := range routes { | ||
level.Debug(logger).Log("request_path_added", r.RequestPath) | ||
addRoute(e, r.RequestPath, r.Service, logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your great work. Overall, it looks good to me.
I have some concerns.
If we use addRoute
here, does it mean all obsolete routes would remain?
I am not sure is there elegant way to reload the routes at once. At the worst case, we can list routes, and then delete them except /metrics
, /debug/pprof/*
, /config
and /reload
. It would be great if we can add test a case as well.
Let me know if you have any concern.
Adds a new handler that accepts
POST /reload
which reloads the teams configuration file. This is very useful when running prometheus-msteams with https://github.com/jimmidyson/configmap-reload to reload configuration when changes occurs in a ConfigMap.