Change gateway service to use service traceprovider (#6799)

This changes the gateway service to use the service traceprovider.
This commit is contained in:
Daniël Franke
2023-07-14 13:22:04 +02:00
committed by GitHub
parent 6f8f5f9ffc
commit e1fb4c315b
4 changed files with 28 additions and 31 deletions
+3 -3
View File
@@ -11,13 +11,13 @@ import (
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/registry"
"github.com/owncloud/ocis/v2/ocis-pkg/tracing"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
"github.com/owncloud/ocis/v2/services/gateway/pkg/config"
"github.com/owncloud/ocis/v2/services/gateway/pkg/config/parser"
"github.com/owncloud/ocis/v2/services/gateway/pkg/logging"
"github.com/owncloud/ocis/v2/services/gateway/pkg/revaconfig"
"github.com/owncloud/ocis/v2/services/gateway/pkg/server/debug"
"github.com/owncloud/ocis/v2/services/gateway/pkg/tracing"
"github.com/urfave/cli/v2"
)
@@ -32,7 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
},
Action: func(c *cli.Context) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
err := tracing.Configure(cfg, logger)
traceProvider, err := tracing.GetServiceTraceProvider(cfg.Tracing, cfg.Service.Name)
if err != nil {
return err
}
@@ -49,6 +49,7 @@ func Server(cfg *config.Config) *cli.Command {
runtime.RunWithOptions(rCfg, pidFile,
runtime.WithLogger(&logger.Logger),
runtime.WithRegistry(reg),
runtime.WithTraceProvider(traceProvider),
)
return nil
@@ -66,7 +67,6 @@ func Server(cfg *config.Config) *cli.Command {
debug.Context(ctx),
debug.Config(cfg),
)
if err != nil {
logger.Info().Err(err).Str("server", "debug").Msg("Failed to initialize server")
return err