diff --git a/tracing/config.go b/tracing/config.go index 25fe0f5..05a0771 100644 --- a/tracing/config.go +++ b/tracing/config.go @@ -28,12 +28,18 @@ func Configure(tc *Config, log logrus.FieldLogger, svcName string) { if tc.Enabled { tracerAddr := fmt.Sprintf("%s:%s", tc.Host, tc.Port) tracerOps := []tracer.StartOption{ - tracer.WithServiceName(svcName), + tracer.WithService(svcName), tracer.WithAgentAddr(tracerAddr), tracer.WithDebugMode(tc.EnableDebug), tracer.WithLogger(debugLogger{log.WithField("component", "opentracing")}), } + if tc.UseDatadog { + tracerOps = append(tracerOps, tracer.WithLogger(debugLogger{log.WithField("component", "datadog")})) + } else { + tracerOps = append(tracerOps, tracer.WithLogger(debugLogger{log.WithField("component", "opentracing")})) + } + for k, v := range tc.Tags { tracerOps = append(tracerOps, tracer.WithGlobalTag(k, v)) }