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
@@ -7,6 +7,8 @@ import (
"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/stream"
"github.com/oklog/run"
"github.com/urfave/cli/v2"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
"github.com/owncloud/ocis/v2/ocis-pkg/service/debug"
@@ -16,7 +18,6 @@ import (
"github.com/owncloud/ocis/v2/services/audit/pkg/logging"
svc "github.com/owncloud/ocis/v2/services/audit/pkg/service"
"github.com/owncloud/ocis/v2/services/audit/pkg/types"
"github.com/urfave/cli/v2"
)
// Server is the entrypoint for the server command.
@@ -57,6 +58,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),
@@ -65,8 +71,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) {