enhancement: add readyz and healthz check handler

This commit is contained in:
Florian Schade
2024-10-14 08:39:42 +02:00
committed by Christian Richter
parent c82a7c560e
commit 0671039474
49 changed files with 511 additions and 199 deletions
+9 -3
View File
@@ -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
}