Migrate frontend to new service tracing setup.

This alters the frontend to use the new service tracing setup.
This commit is contained in:
Daniël Franke
2023-06-29 10:40:00 +02:00
parent f15ed6bc91
commit 7a229e438b
21 changed files with 98 additions and 83 deletions
+3 -3
View File
@@ -12,13 +12,13 @@ import (
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/registry"
"github.com/owncloud/ocis/v2/ocis-pkg/sync"
"github.com/owncloud/ocis/v2/ocis-pkg/tracing"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
"github.com/owncloud/ocis/v2/services/frontend/pkg/config"
"github.com/owncloud/ocis/v2/services/frontend/pkg/config/parser"
"github.com/owncloud/ocis/v2/services/frontend/pkg/logging"
"github.com/owncloud/ocis/v2/services/frontend/pkg/revaconfig"
"github.com/owncloud/ocis/v2/services/frontend/pkg/server/debug"
"github.com/owncloud/ocis/v2/services/frontend/pkg/tracing"
"github.com/urfave/cli/v2"
)
@@ -33,7 +33,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)
tracingProvider, err := tracing.GetServiceTraceProvider(cfg.Tracing, cfg.Service.Name)
if err != nil {
return err
}
@@ -54,6 +54,7 @@ func Server(cfg *config.Config) *cli.Command {
runtime.RunWithOptions(rCfg, pidFile,
runtime.WithLogger(&logger.Logger),
runtime.WithRegistry(reg),
runtime.WithTraceProvider(tracingProvider),
)
return nil
@@ -71,7 +72,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