diff --git a/crossdock/server/tchannel.go b/crossdock/server/tchannel.go index 5105b331..b99050a3 100644 --- a/crossdock/server/tchannel.go +++ b/crossdock/server/tchannel.go @@ -117,7 +117,7 @@ func convertOpenTracingSpan(ctx context.Context, builder *tchannel.ContextBuilde return } sc := new(jaeger.SpanContext) - if err := span.Tracer().Inject(span.Context(), jaeger.TraceContextFormat, sc); err != nil { + if err := span.Tracer().Inject(span.Context(), jaeger.SpanContextFormat, sc); err != nil { return } builder.SetExternalSpan(sc.TraceID(), sc.SpanID(), sc.ParentID(), sc.IsSampled()) diff --git a/interop.go b/interop.go index bbe64e04..1f7aefc9 100644 --- a/interop.go +++ b/interop.go @@ -28,10 +28,10 @@ import ( type formatKey int -// TraceContextFormat is a constant used as OpenTracing Format. +// SpanContextFormat is a constant used as OpenTracing Format. // Requires *SpanContext as carrier. // This format is intended for interop with TChannel or other Zipkin-like tracers. -const TraceContextFormat formatKey = iota +const SpanContextFormat formatKey = iota type jaegerTraceContextPropagator struct { tracer *tracer diff --git a/propagation_test.go b/propagation_test.go index f7ff2078..14a9adba 100644 --- a/propagation_test.go +++ b/propagation_test.go @@ -23,7 +23,7 @@ func TestSpanPropagator(t *testing.T) { tests := []struct { format, carrier, formatName interface{} }{ - {TraceContextFormat, new(SpanContext), "TraceContextFormat"}, + {SpanContextFormat, new(SpanContext), "TraceContextFormat"}, {opentracing.Binary, new(bytes.Buffer), "Binary"}, {opentracing.TextMap, tmc, "TextMap"}, } diff --git a/tracer.go b/tracer.go index 01778f12..4f3618ed 100644 --- a/tracer.go +++ b/tracer.go @@ -84,8 +84,8 @@ func NewTracer( t.extractors[opentracing.Binary] = binaryPropagator interopPropagator := &jaegerTraceContextPropagator{tracer: t} - t.injectors[TraceContextFormat] = interopPropagator - t.extractors[TraceContextFormat] = interopPropagator + t.injectors[SpanContextFormat] = interopPropagator + t.extractors[SpanContextFormat] = interopPropagator zipkinPropagator := &zipkinPropagator{tracer: t} t.injectors[ZipkinSpanFormat] = zipkinPropagator