enhancement: add readyz and healthz check handler
This commit is contained in:
committed by
Christian Richter
parent
c82a7c560e
commit
0671039474
@@ -16,6 +16,12 @@ import (
|
||||
func Server(opts ...Option) (*http.Server, error) {
|
||||
options := newOptions(opts...)
|
||||
|
||||
checkHandler := handlers.NewCheckHandler(
|
||||
handlers.NewCheckHandlerConfiguration().
|
||||
WithLogger(options.Logger),
|
||||
)
|
||||
|
||||
var configDumpFunc http.HandlerFunc = configDump(options.Config)
|
||||
return debug.NewService(
|
||||
debug.Logger(options.Logger),
|
||||
debug.Name(options.Config.Service.Name),
|
||||
@@ -24,9 +30,9 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
debug.Token(options.Config.Debug.Token),
|
||||
debug.Pprof(options.Config.Debug.Pprof),
|
||||
debug.Zpages(options.Config.Debug.Zpages),
|
||||
debug.Health(handlers.Health),
|
||||
debug.Ready(handlers.Ready),
|
||||
debug.ConfigDump(configDump(options.Config)),
|
||||
debug.Health(checkHandler),
|
||||
debug.Ready(checkHandler),
|
||||
debug.ConfigDump(configDumpFunc),
|
||||
), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user