11package command
22
33import (
4- "fmt"
54 "net"
65 "os"
76 "path/filepath"
@@ -14,7 +13,6 @@ import (
1413 "github.com/opentracing/opentracing-go"
1514 gopilosa "github.com/pilosa/go-pilosa"
1615 "github.com/sirupsen/logrus"
17- jaeger "github.com/uber/jaeger-client-go"
1816 "github.com/uber/jaeger-client-go/config"
1917 sqle "gopkg.in/src-d/go-mysql-server.v0"
2018 "gopkg.in/src-d/go-mysql-server.v0/server"
@@ -82,17 +80,17 @@ func (c *Server) Execute(args []string) error {
8280
8381 var tracer opentracing.Tracer
8482 if c .TraceEnabled {
85- if os .Getenv ("JAEGER_SERVICE_NAME" ) == "" {
86- os .Setenv ("JAEGER_SERVICE_NAME" , TracerServiceName )
87- }
88-
8983 cfg , err := config .FromEnv ()
9084 if err != nil {
9185 logrus .WithField ("error" , err ).
9286 Fatal ("unable to read jaeger environment" )
9387 return err
9488 }
9589
90+ if cfg .ServiceName == "" {
91+ cfg .ServiceName = TracerServiceName
92+ }
93+
9694 logger := & jaegerLogrus {logrus .WithField ("subsystem" , "jaeger" )}
9795
9896 t , closer , err := cfg .NewTracer (
@@ -107,18 +105,7 @@ func (c *Server) Execute(args []string) error {
107105 tracer = t
108106 defer closer .Close ()
109107
110- jaegerHost := os .Getenv ("JAEGER_AGENT_HOST" )
111- if jaegerHost == "" {
112- jaegerHost = jaeger .DefaultUDPSpanServerHost
113- }
114-
115- jaegerPort := os .Getenv ("JAEGER_AGENT_PORT" )
116- if jaegerPort == "" {
117- jaegerPort = strconv .Itoa (jaeger .DefaultUDPSpanServerPort )
118- }
119-
120- endpoint := fmt .Sprintf ("%s:%s" , jaegerHost , jaegerPort )
121- logrus .WithField ("endpoint" , endpoint ).Info ("tracing enabled" )
108+ logrus .Info ("tracing enabled" )
122109 }
123110
124111 hostString := net .JoinHostPort (c .Host , strconv .Itoa (c .Port ))
0 commit comments