@@ -28,12 +28,12 @@ import (
2828)
2929
3030//generate trace jobs (goroutine), use context and chan to control jobs and release goroutine .
31- func GenerateTracingJobs (pch chan <- context.Context , parent context.Context , svc string , header http.Header , tags map [string ]string , traceType string ) {
31+ func GenerateTracingJobs (pch chan <- context.Context , parent context.Context , svc , spanName string , header http.Header , tags map [string ]string , traceType string ) {
3232 // setting context
3333 ctx , cancel := context .WithCancel (parent )
3434 // setting chan
3535 ch := make (chan context.Context , 0 )
36- go doTask (ch , ctx , svc , header , tags , traceType )
36+ go doTask (ch , ctx , svc , spanName , header , tags , traceType )
3737 // receive signal
3838 pctx := <- ch
3939 pch <- pctx
@@ -51,7 +51,7 @@ func GenerateTracingJobs(pch chan<- context.Context, parent context.Context, svc
5151
5252// do trace reporter
5353func doTask (ch chan context.Context , parent context.Context ,
54- svc string , header http.Header , tags map [string ]string , traceType string ) {
54+ svc , spanName string , header http.Header , tags map [string ]string , traceType string ) {
5555 //定义 tracer, closer
5656 var tracer opentracing.Tracer
5757 var closer io.Closer
@@ -60,7 +60,7 @@ func doTask(ch chan context.Context, parent context.Context,
6060 switch traceType {
6161 case "jaeger" :
6262 tracer , closer = tracing .InitJaeger (svc )
63- ctx = tracing .AddTracer (svc , parent , header , tracer , tags )
63+ ctx = tracing .AddTracer (svc , spanName , parent , header , tracer , tags )
6464 break
6565 case "zipkin" :
6666 log .Println ("create zipkin tracing job" )
0 commit comments