add tracing

This commit is contained in:
A.Unger
2020-03-10 15:15:22 +01:00
parent 065c8a2475
commit dfd6bfa2cc
2 changed files with 7 additions and 2 deletions

View File

@@ -70,6 +70,10 @@ func Server(cfg *config.Config) *cli.Command {
},
)
logger.Info().
Str("collector", cfg.Tracing.Collector).
Msg("Trace collector added")
if err != nil {
logger.Error().
Err(err).
@@ -137,8 +141,8 @@ func Server(cfg *config.Config) *cli.Command {
http.Context(ctx),
http.Config(cfg),
http.Metrics(metrics),
http.Flags(flagset.RootWithConfig(cfg)),
http.Flags(flagset.ServerWithConfig(cfg)),
http.Flags(flagset.RootWithConfig(config.New())),
http.Flags(flagset.ServerWithConfig(config.New())),
)
if err != nil {

View File

@@ -57,6 +57,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.BoolFlag{
Name: "tracing-enabled",
Value: false,
Usage: "Enable sending traces",
EnvVars: []string{"OCS_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,