enhancement: add readyz and healthz check handler

This commit is contained in:
Florian Schade
2024-09-25 11:45:12 +02:00
committed by Christian Richter
parent c82a7c560e
commit 0671039474
49 changed files with 511 additions and 199 deletions
+10 -4
View File
@@ -8,6 +8,9 @@ import (
"github.com/cs3org/reva/v2/pkg/events/stream"
"github.com/cs3org/reva/v2/pkg/store"
"github.com/oklog/run"
"github.com/urfave/cli/v2"
microstore "go-micro.dev/v4/store"
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
"github.com/owncloud/ocis/v2/ocis-pkg/service/debug"
"github.com/owncloud/ocis/v2/ocis-pkg/tracing"
@@ -16,8 +19,6 @@ import (
"github.com/owncloud/ocis/v2/services/postprocessing/pkg/config/parser"
"github.com/owncloud/ocis/v2/services/postprocessing/pkg/logging"
"github.com/owncloud/ocis/v2/services/postprocessing/pkg/service"
"github.com/urfave/cli/v2"
microstore "go-micro.dev/v4/store"
)
// Server is the entrypoint for the server command.
@@ -86,6 +87,11 @@ func Server(cfg *config.Config) *cli.Command {
}
{
checkHandler := handlers.NewCheckHandler(
handlers.NewCheckHandlerConfiguration().
WithLogger(logger),
)
server := debug.NewService(
debug.Logger(logger),
debug.Name(cfg.Service.Name),
@@ -94,8 +100,8 @@ func Server(cfg *config.Config) *cli.Command {
debug.Token(cfg.Debug.Token),
debug.Pprof(cfg.Debug.Pprof),
debug.Zpages(cfg.Debug.Zpages),
debug.Health(handlers.Health),
debug.Ready(handlers.Ready),
debug.Health(checkHandler),
debug.Ready(checkHandler),
)
gr.Add(server.ListenAndServe, func(_ error) {