1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-13 01:00:22 +02:00

Rename trace.TraceID & trace.TraceIDFromHex

This commit is contained in:
tensorchen
2020-05-02 20:23:09 +08:00
parent c6c155de6f
commit bae2298a36
31 changed files with 88 additions and 88 deletions

View File

@ -32,7 +32,7 @@ type alwaysOffSampler struct{}
func (ns alwaysOffSampler) ShouldSample( func (ns alwaysOffSampler) ShouldSample(
_ SpanContext, _ SpanContext,
_ bool, _ bool,
_ TraceID, _ ID,
_ SpanID, _ SpanID,
_ string, _ string,
_ SpanKind, _ SpanKind,

View File

@ -24,7 +24,7 @@ import (
func TestNeverSamperShouldSample(t *testing.T) { func TestNeverSamperShouldSample(t *testing.T) {
gotD := AlwaysOffSampler().ShouldSample( gotD := AlwaysOffSampler().ShouldSample(
SpanContext{}, false, TraceID{}, SpanID{}, "span", SpanKindClient, []core.KeyValue{}, []Link{}) SpanContext{}, false, ID{}, SpanID{}, "span", SpanKindClient, []core.KeyValue{}, []Link{})
wantD := Decision{Sampled: false} wantD := Decision{Sampled: false}
if diff := cmp.Diff(wantD, gotD); diff != "" { if diff := cmp.Diff(wantD, gotD); diff != "" {
t.Errorf("Decision: +got, -want%v", diff) t.Errorf("Decision: +got, -want%v", diff)

View File

@ -32,7 +32,7 @@ type alwaysOnSampler struct{}
func (as alwaysOnSampler) ShouldSample( func (as alwaysOnSampler) ShouldSample(
_ SpanContext, _ SpanContext,
_ bool, _ bool,
_ TraceID, _ ID,
_ SpanID, _ SpanID,
_ string, _ string,
_ SpanKind, _ SpanKind,

View File

@ -24,7 +24,7 @@ import (
func TestAlwaysOnSamplerShouldSample(t *testing.T) { func TestAlwaysOnSamplerShouldSample(t *testing.T) {
gotD := AlwaysOnSampler().ShouldSample( gotD := AlwaysOnSampler().ShouldSample(
SpanContext{}, false, TraceID{}, SpanID{}, "span", SpanKindClient, []core.KeyValue{}, []Link{}) SpanContext{}, false, ID{}, SpanID{}, "span", SpanKindClient, []core.KeyValue{}, []Link{})
wantD := Decision{Sampled: true} wantD := Decision{Sampled: true}
if diff := cmp.Diff(wantD, gotD); diff != "" { if diff := cmp.Diff(wantD, gotD); diff != "" {
t.Errorf("Decision: +got, -want%v", diff) t.Errorf("Decision: +got, -want%v", diff)

View File

@ -88,7 +88,7 @@ func (b3 B3) Extract(ctx context.Context, supplier propagation.HTTPSupplier) con
} }
func (b3 B3) extract(supplier propagation.HTTPSupplier) SpanContext { func (b3 B3) extract(supplier propagation.HTTPSupplier) SpanContext {
tid, err := TraceIDFromHex(supplier.Get(B3TraceIDHeader)) tid, err := IDFromHex(supplier.Get(B3TraceIDHeader))
if err != nil { if err != nil {
return EmptySpanContext() return EmptySpanContext()
} }
@ -139,7 +139,7 @@ func (b3 B3) extractSingleHeader(supplier propagation.HTTPSupplier) SpanContext
} }
var err error var err error
sc.TraceID, err = TraceIDFromHex(parts[0]) sc.TraceID, err = IDFromHex(parts[0])
if err != nil { if err != nil {
return EmptySpanContext() return EmptySpanContext()
} }

View File

@ -23,7 +23,7 @@ type Sampler interface {
ShouldSample( ShouldSample(
sc SpanContext, sc SpanContext,
remote bool, remote bool,
traceID TraceID, traceID ID,
spanID SpanID, spanID SpanID,
spanName string, spanName string,
spanKind SpanKind, spanKind SpanKind,

View File

@ -44,26 +44,26 @@ func (e errorConst) Error() string {
return string(e) return string(e)
} }
// TraceID is a unique identity of a trace. // ID is a unique identity of a trace.
type TraceID [16]byte type ID [16]byte
var nilTraceID TraceID var nilTraceID ID
var _ json.Marshaler = nilTraceID var _ json.Marshaler = nilTraceID
// IsValid checks whether the trace ID is valid. A valid trace ID does // IsValid checks whether the trace ID is valid. A valid trace ID does
// not consist of zeros only. // not consist of zeros only.
func (t TraceID) IsValid() bool { func (t ID) IsValid() bool {
return !bytes.Equal(t[:], nilTraceID[:]) return !bytes.Equal(t[:], nilTraceID[:])
} }
// MarshalJSON implements a custom marshal function to encode TraceID // MarshalJSON implements a custom marshal function to encode TraceID
// as a hex string. // as a hex string.
func (t TraceID) MarshalJSON() ([]byte, error) { func (t ID) MarshalJSON() ([]byte, error) {
return json.Marshal(t.String()) return json.Marshal(t.String())
} }
// String returns the hex string representation form of a TraceID // String returns the hex string representation form of a TraceID
func (t TraceID) String() string { func (t ID) String() string {
return hex.EncodeToString(t[:]) return hex.EncodeToString(t[:])
} }
@ -90,11 +90,11 @@ func (s SpanID) String() string {
return hex.EncodeToString(s[:]) return hex.EncodeToString(s[:])
} }
// TraceIDFromHex returns a TraceID from a hex string if it is compliant // IDFromHex returns a TraceID from a hex string if it is compliant
// with the w3c trace-context specification. // with the w3c trace-context specification.
// See more at https://www.w3.org/TR/trace-context/#trace-id // See more at https://www.w3.org/TR/trace-context/#trace-id
func TraceIDFromHex(h string) (TraceID, error) { func IDFromHex(h string) (ID, error) {
t := TraceID{} t := ID{}
if len(h) != 32 { if len(h) != 32 {
return t, ErrInvalidTraceIDLength return t, ErrInvalidTraceIDLength
} }
@ -152,7 +152,7 @@ func decodeHex(h string, b []byte) error {
// SpanContext contains basic information about the span - its trace // SpanContext contains basic information about the span - its trace
// ID, span ID and trace flags. // ID, span ID and trace flags.
type SpanContext struct { type SpanContext struct {
TraceID TraceID TraceID ID
SpanID SpanID SpanID SpanID
TraceFlags byte TraceFlags byte
} }

View File

@ -23,7 +23,7 @@ import (
func TestIsValid(t *testing.T) { func TestIsValid(t *testing.T) {
for _, testcase := range []struct { for _, testcase := range []struct {
name string name string
tid trace.TraceID tid trace.ID
sid trace.SpanID sid trace.SpanID
want bool want bool
}{ }{
@ -34,17 +34,17 @@ func TestIsValid(t *testing.T) {
want: true, want: true,
}, { }, {
name: "SpanContext.IsValid() returns false if sc has neither an Trace ID nor Span ID", name: "SpanContext.IsValid() returns false if sc has neither an Trace ID nor Span ID",
tid: trace.TraceID([16]byte{}), tid: trace.ID([16]byte{}),
sid: [8]byte{}, sid: [8]byte{},
want: false, want: false,
}, { }, {
name: "SpanContext.IsValid() returns false if sc has a Span ID but not a Trace ID", name: "SpanContext.IsValid() returns false if sc has a Span ID but not a Trace ID",
tid: trace.TraceID([16]byte{}), tid: trace.ID([16]byte{}),
sid: [8]byte{42}, sid: [8]byte{42},
want: false, want: false,
}, { }, {
name: "SpanContext.IsValid() returns false if sc has a Trace ID but not a Span ID", name: "SpanContext.IsValid() returns false if sc has a Trace ID but not a Span ID",
tid: trace.TraceID([16]byte{1}), tid: trace.ID([16]byte{1}),
sid: [8]byte{}, sid: [8]byte{},
want: false, want: false,
}, },
@ -66,12 +66,12 @@ func TestIsValidFromHex(t *testing.T) {
for _, testcase := range []struct { for _, testcase := range []struct {
name string name string
hex string hex string
tid trace.TraceID tid trace.ID
valid bool valid bool
}{ }{
{ {
name: "Valid TraceID", name: "Valid TraceID",
tid: trace.TraceID([16]byte{128, 241, 152, 238, 86, 52, 59, 168, 100, 254, 139, 42, 87, 211, 239, 247}), tid: trace.ID([16]byte{128, 241, 152, 238, 86, 52, 59, 168, 100, 254, 139, 42, 87, 211, 239, 247}),
hex: "80f198ee56343ba864fe8b2a57d3eff7", hex: "80f198ee56343ba864fe8b2a57d3eff7",
valid: true, valid: true,
}, { }, {
@ -89,7 +89,7 @@ func TestIsValidFromHex(t *testing.T) {
}, },
} { } {
t.Run(testcase.name, func(t *testing.T) { t.Run(testcase.name, func(t *testing.T) {
tid, err := trace.TraceIDFromHex(testcase.hex) tid, err := trace.IDFromHex(testcase.hex)
if testcase.valid && err != nil { if testcase.valid && err != nil {
t.Errorf("Expected TraceID %s to be valid but end with error %s", testcase.hex, err.Error()) t.Errorf("Expected TraceID %s to be valid but end with error %s", testcase.hex, err.Error())
@ -109,16 +109,16 @@ func TestIsValidFromHex(t *testing.T) {
func TestHasTraceID(t *testing.T) { func TestHasTraceID(t *testing.T) {
for _, testcase := range []struct { for _, testcase := range []struct {
name string name string
tid trace.TraceID tid trace.ID
want bool want bool
}{ }{
{ {
name: "SpanContext.HasTraceID() returns true if both Low and High are nonzero", name: "SpanContext.HasTraceID() returns true if both Low and High are nonzero",
tid: trace.TraceID([16]byte{1}), tid: trace.ID([16]byte{1}),
want: true, want: true,
}, { }, {
name: "SpanContext.HasTraceID() returns false if neither Low nor High are nonzero", name: "SpanContext.HasTraceID() returns false if neither Low nor High are nonzero",
tid: trace.TraceID{}, tid: trace.ID{},
want: false, want: false,
}, },
} { } {
@ -168,20 +168,20 @@ func TestSpanContextIsSampled(t *testing.T) {
{ {
name: "sampled", name: "sampled",
sc: trace.SpanContext{ sc: trace.SpanContext{
TraceID: trace.TraceID([16]byte{1}), TraceID: trace.ID([16]byte{1}),
TraceFlags: trace.TraceFlagsSampled, TraceFlags: trace.TraceFlagsSampled,
}, },
want: true, want: true,
}, { }, {
name: "sampled plus unused", name: "sampled plus unused",
sc: trace.SpanContext{ sc: trace.SpanContext{
TraceID: trace.TraceID([16]byte{1}), TraceID: trace.ID([16]byte{1}),
TraceFlags: trace.TraceFlagsSampled | trace.TraceFlagsUnused, TraceFlags: trace.TraceFlagsSampled | trace.TraceFlagsUnused,
}, },
want: true, want: true,
}, { }, {
name: "not sampled/default", name: "not sampled/default",
sc: trace.SpanContext{TraceID: trace.TraceID{}}, sc: trace.SpanContext{TraceID: trace.ID{}},
want: false, want: false,
}, },
} { } {
@ -197,17 +197,17 @@ func TestSpanContextIsSampled(t *testing.T) {
func TestStringTraceID(t *testing.T) { func TestStringTraceID(t *testing.T) {
for _, testcase := range []struct { for _, testcase := range []struct {
name string name string
tid trace.TraceID tid trace.ID
want string want string
}{ }{
{ {
name: "TraceID.String returns string representation of self.TraceID values > 0", name: "TraceID.String returns string representation of self.TraceID values > 0",
tid: trace.TraceID([16]byte{255}), tid: trace.ID([16]byte{255}),
want: "ff000000000000000000000000000000", want: "ff000000000000000000000000000000",
}, },
{ {
name: "TraceID.String returns string representation of self.TraceID values == 0", name: "TraceID.String returns string representation of self.TraceID values == 0",
tid: trace.TraceID([16]byte{}), tid: trace.ID([16]byte{}),
want: "00000000000000000000000000000000", want: "00000000000000000000000000000000",
}, },
} { } {

View File

@ -22,7 +22,7 @@ import (
) )
type Generator interface { type Generator interface {
TraceID() trace.TraceID TraceID() trace.ID
SpanID() trace.SpanID SpanID() trace.SpanID
} }
@ -41,7 +41,7 @@ func NewCountGenerator() *CountGenerator {
return &CountGenerator{} return &CountGenerator{}
} }
func (g *CountGenerator) TraceID() trace.TraceID { func (g *CountGenerator) TraceID() trace.ID {
g.lock.Lock() g.lock.Lock()
defer g.lock.Unlock() defer g.lock.Unlock()
@ -51,7 +51,7 @@ func (g *CountGenerator) TraceID() trace.TraceID {
g.traceIDLow++ g.traceIDLow++
} }
var traceID trace.TraceID var traceID trace.ID
binary.BigEndian.PutUint64(traceID[0:8], g.traceIDLow) binary.BigEndian.PutUint64(traceID[0:8], g.traceIDLow)
binary.BigEndian.PutUint64(traceID[8:], g.traceIDHigh) binary.BigEndian.PutUint64(traceID[8:], g.traceIDHigh)

View File

@ -32,7 +32,7 @@ type outOfThinAirPropagator struct {
var _ propagation.HTTPPropagator = outOfThinAirPropagator{} var _ propagation.HTTPPropagator = outOfThinAirPropagator{}
func (p outOfThinAirPropagator) Extract(ctx context.Context, supplier propagation.HTTPSupplier) context.Context { func (p outOfThinAirPropagator) Extract(ctx context.Context, supplier propagation.HTTPSupplier) context.Context {
traceID, err := trace.TraceIDFromHex("938753245abe987f098c0987a9873987") traceID, err := trace.IDFromHex("938753245abe987f098c0987a9873987")
require.NoError(p.t, err) require.NoError(p.t, err)
spanID, err := trace.SpanIDFromHex("2345f98c0987a09d") spanID, err := trace.SpanIDFromHex("2345f98c0987a09d")
require.NoError(p.t, err) require.NoError(p.t, err)

View File

@ -39,7 +39,7 @@ func injectSubBenchmarks(b *testing.B, fn func(context.Context, *testing.B)) {
b.Run("SampledSpanContext", func(b *testing.B) { b.Run("SampledSpanContext", func(b *testing.B) {
var id uint64 var id uint64
spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7") spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7")
traceID, _ := trace.TraceIDFromHex("4bf92f3577b34da6a3ce929d0e0e4736") traceID, _ := trace.IDFromHex("4bf92f3577b34da6a3ce929d0e0e4736")
mockTracer := &mocktrace.MockTracer{ mockTracer := &mocktrace.MockTracer{
Sampled: false, Sampled: false,

View File

@ -31,8 +31,8 @@ var (
spanID = mustSpanIDFromHex("00f067aa0ba902b7") spanID = mustSpanIDFromHex("00f067aa0ba902b7")
) )
func mustTraceIDFromHex(s string) (t trace.TraceID) { func mustTraceIDFromHex(s string) (t trace.ID) {
t, _ = trace.TraceIDFromHex(s) t, _ = trace.IDFromHex(s)
return return
} }

View File

@ -51,7 +51,7 @@ func (t *Tracer) Start(ctx context.Context, name string, opts ...trace.StartOpti
opt(&c) opt(&c)
} }
var traceID trace.TraceID var traceID trace.ID
var parentSpanID trace.SpanID var parentSpanID trace.SpanID
parentSpanContext, _, links := parent.GetSpanContextAndLinks(ctx, c.NewRoot) parentSpanContext, _, links := parent.GetSpanContextAndLinks(ctx, c.NewRoot)

View File

@ -101,7 +101,7 @@ func (TraceContext) extract(supplier propagation.HTTPSupplier) SpanContext {
var sc SpanContext var sc SpanContext
sc.TraceID, err = TraceIDFromHex(sections[1][:32]) sc.TraceID, err = IDFromHex(sections[1][:32])
if err != nil { if err != nil {
return EmptySpanContext() return EmptySpanContext()
} }

View File

@ -49,7 +49,7 @@ type MockContextKeyValue struct {
type MockTracer struct { type MockTracer struct {
Resources otelcorrelation.Map Resources otelcorrelation.Map
FinishedSpans []*MockSpan FinishedSpans []*MockSpan
SpareTraceIDs []oteltrace.TraceID SpareTraceIDs []oteltrace.ID
SpareSpanIDs []oteltrace.SpanID SpareSpanIDs []oteltrace.SpanID
SpareContextKeyValues []MockContextKeyValue SpareContextKeyValues []MockContextKeyValue
@ -126,7 +126,7 @@ func (t *MockTracer) addSpareContextValue(ctx context.Context) context.Context {
return ctx return ctx
} }
func (t *MockTracer) getTraceID(ctx context.Context, spanOpts *oteltrace.StartConfig) oteltrace.TraceID { func (t *MockTracer) getTraceID(ctx context.Context, spanOpts *oteltrace.StartConfig) oteltrace.ID {
if parent := t.getParentSpanContext(ctx, spanOpts); parent.IsValid() { if parent := t.getParentSpanContext(ctx, spanOpts); parent.IsValid() {
return parent.TraceID return parent.TraceID
} }
@ -175,11 +175,11 @@ func (t *MockTracer) getRandSpanID() oteltrace.SpanID {
return sid return sid
} }
func (t *MockTracer) getRandTraceID() oteltrace.TraceID { func (t *MockTracer) getRandTraceID() oteltrace.ID {
t.randLock.Lock() t.randLock.Lock()
defer t.randLock.Unlock() defer t.randLock.Unlock()
tid := oteltrace.TraceID{} tid := oteltrace.ID{}
t.rand.Read(tid[:]) t.rand.Read(tid[:])
return tid return tid

View File

@ -143,7 +143,7 @@ func TestMixedAPIs(t *testing.T) {
// simple test // simple test
type simpleTest struct { type simpleTest struct {
traceID oteltrace.TraceID traceID oteltrace.ID
spanIDs []oteltrace.SpanID spanIDs []oteltrace.SpanID
} }
@ -178,7 +178,7 @@ func (st *simpleTest) noop(t *testing.T, ctx context.Context) context.Context {
// current/active span test // current/active span test
type currentActiveSpanTest struct { type currentActiveSpanTest struct {
traceID oteltrace.TraceID traceID oteltrace.ID
spanIDs []oteltrace.SpanID spanIDs []oteltrace.SpanID
recordedCurrentOtelSpanIDs []oteltrace.SpanID recordedCurrentOtelSpanIDs []oteltrace.SpanID
@ -614,7 +614,7 @@ func generateBaggageKeys(key string) (otKey, otelKey string) {
// helpers // helpers
func checkTraceAndSpans(t *testing.T, tracer *internal.MockTracer, expectedTraceID oteltrace.TraceID, expectedSpanIDs []oteltrace.SpanID) { func checkTraceAndSpans(t *testing.T, tracer *internal.MockTracer, expectedTraceID oteltrace.ID, expectedSpanIDs []oteltrace.SpanID) {
expectedSpanCount := len(expectedSpanIDs) expectedSpanCount := len(expectedSpanIDs)
// reverse spanIDs, since first span ID belongs to root, that // reverse spanIDs, since first span ID belongs to root, that
@ -661,7 +661,7 @@ func reverse(length int, swap func(i, j int)) {
} }
} }
func simpleTraceID() oteltrace.TraceID { func simpleTraceID() oteltrace.ID {
return [16]byte{123, 42} return [16]byte{123, 42}
} }

View File

@ -271,7 +271,7 @@ func TestSpanData(t *testing.T) {
endTime := startTime.Add(10 * time.Second) endTime := startTime.Add(10 * time.Second)
spanData := &export.SpanData{ spanData := &export.SpanData{
SpanContext: apitrace.SpanContext{ SpanContext: apitrace.SpanContext{
TraceID: apitrace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: apitrace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: apitrace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: apitrace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
SpanKind: apitrace.SpanKindServer, SpanKind: apitrace.SpanKindServer,
@ -294,7 +294,7 @@ func TestSpanData(t *testing.T) {
Links: []apitrace.Link{ Links: []apitrace.Link{
{ {
SpanContext: apitrace.SpanContext{ SpanContext: apitrace.SpanContext{
TraceID: apitrace.TraceID{0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF}, TraceID: apitrace.ID{0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF},
SpanID: apitrace.SpanID{0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7}, SpanID: apitrace.SpanID{0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7},
TraceFlags: 0, TraceFlags: 0,
}, },
@ -304,7 +304,7 @@ func TestSpanData(t *testing.T) {
}, },
{ {
SpanContext: apitrace.SpanContext{ SpanContext: apitrace.SpanContext{
TraceID: apitrace.TraceID{0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF}, TraceID: apitrace.ID{0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF},
SpanID: apitrace.SpanID{0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7}, SpanID: apitrace.SpanID{0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7},
TraceFlags: 0, TraceFlags: 0,
}, },

View File

@ -82,7 +82,7 @@ func TestExportSpans(t *testing.T) {
[]*tracesdk.SpanData{ []*tracesdk.SpanData{
{ {
SpanContext: apitrace.SpanContext{ SpanContext: apitrace.SpanContext{
TraceID: apitrace.TraceID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}), TraceID: apitrace.ID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}),
SpanID: apitrace.SpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 1}), SpanID: apitrace.SpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 1}),
TraceFlags: byte(1), TraceFlags: byte(1),
}, },
@ -100,7 +100,7 @@ func TestExportSpans(t *testing.T) {
}, },
{ {
SpanContext: apitrace.SpanContext{ SpanContext: apitrace.SpanContext{
TraceID: apitrace.TraceID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}), TraceID: apitrace.ID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}),
SpanID: apitrace.SpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 2}), SpanID: apitrace.SpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 2}),
TraceFlags: byte(1), TraceFlags: byte(1),
}, },
@ -119,7 +119,7 @@ func TestExportSpans(t *testing.T) {
}, },
{ {
SpanContext: apitrace.SpanContext{ SpanContext: apitrace.SpanContext{
TraceID: apitrace.TraceID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}), TraceID: apitrace.ID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}),
SpanID: apitrace.SpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 1}), SpanID: apitrace.SpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 1}),
TraceFlags: byte(1), TraceFlags: byte(1),
}, },

View File

@ -191,10 +191,10 @@ func TestNewRawExporterWithAgentShouldFailIfEndpointInvalid(t *testing.T) {
func Test_spanDataToThrift(t *testing.T) { func Test_spanDataToThrift(t *testing.T) {
now := time.Now() now := time.Now()
traceID, _ := apitrace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10") traceID, _ := apitrace.IDFromHex("0102030405060708090a0b0c0d0e0f10")
spanID, _ := apitrace.SpanIDFromHex("0102030405060708") spanID, _ := apitrace.SpanIDFromHex("0102030405060708")
linkTraceID, _ := apitrace.TraceIDFromHex("0102030405060709090a0b0c0d0e0f11") linkTraceID, _ := apitrace.IDFromHex("0102030405060709090a0b0c0d0e0f11")
linkSpanID, _ := apitrace.SpanIDFromHex("0102030405060709") linkSpanID, _ := apitrace.SpanIDFromHex("0102030405060709")
eventNameValue := "event-test" eventNameValue := "event-test"

View File

@ -40,7 +40,7 @@ func TestExporter_ExportSpan(t *testing.T) {
// setup test span // setup test span
now := time.Now() now := time.Now()
traceID, _ := trace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10") traceID, _ := trace.IDFromHex("0102030405060708090a0b0c0d0e0f10")
spanID, _ := trace.SpanIDFromHex("0102030405060708") spanID, _ := trace.SpanIDFromHex("0102030405060708")
keyValue := "value" keyValue := "value"
doubleValue := 123.456 doubleValue := 123.456

View File

@ -137,7 +137,7 @@ func TestExportSpans(t *testing.T) {
// parent // parent
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{}, ParentSpanID: trace.SpanID{},
@ -153,7 +153,7 @@ func TestExportSpans(t *testing.T) {
// child // child
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xDF, 0xDE, 0xDD, 0xDC, 0xDB, 0xDA, 0xD9, 0xD8}, SpanID: trace.SpanID{0xDF, 0xDE, 0xDD, 0xDC, 0xDB, 0xDA, 0xD9, 0xD8},
}, },
ParentSpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, ParentSpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},

View File

@ -62,7 +62,7 @@ func toZipkinSpanContext(data *export.SpanData) zkmodel.SpanContext {
} }
} }
func toZipkinTraceID(traceID trace.TraceID) zkmodel.TraceID { func toZipkinTraceID(traceID trace.ID) zkmodel.TraceID {
return zkmodel.TraceID{ return zkmodel.TraceID{
High: binary.BigEndian.Uint64(traceID[:8]), High: binary.BigEndian.Uint64(traceID[:8]),
Low: binary.BigEndian.Uint64(traceID[8:]), Low: binary.BigEndian.Uint64(traceID[8:]),

View File

@ -33,7 +33,7 @@ func TestModelConversion(t *testing.T) {
// typical span data // typical span data
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -66,7 +66,7 @@ func TestModelConversion(t *testing.T) {
// invalid parent) // invalid parent)
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{}, ParentSpanID: trace.SpanID{},
@ -98,7 +98,7 @@ func TestModelConversion(t *testing.T) {
// span data of unspecified kind // span data of unspecified kind
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -130,7 +130,7 @@ func TestModelConversion(t *testing.T) {
// span data of internal kind // span data of internal kind
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -162,7 +162,7 @@ func TestModelConversion(t *testing.T) {
// span data of client kind // span data of client kind
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -194,7 +194,7 @@ func TestModelConversion(t *testing.T) {
// span data of producer kind // span data of producer kind
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -226,7 +226,7 @@ func TestModelConversion(t *testing.T) {
// span data of consumer kind // span data of consumer kind
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -258,7 +258,7 @@ func TestModelConversion(t *testing.T) {
// span data with no events // span data with no events
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},
@ -277,7 +277,7 @@ func TestModelConversion(t *testing.T) {
// span data with an "error" attribute set to "false" // span data with an "error" attribute set to "false"
{ {
SpanContext: trace.SpanContext{ SpanContext: trace.SpanContext{
TraceID: trace.TraceID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, TraceID: trace.ID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, SpanID: trace.SpanID{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
}, },
ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38}, ParentSpanID: trace.SpanID{0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38},

View File

@ -218,7 +218,7 @@ func generateSpan(t *testing.T, parallel bool, tr apitrace.Tracer, option testOp
} }
func getSpanContext() apitrace.SpanContext { func getSpanContext() apitrace.SpanContext {
tid, _ := apitrace.TraceIDFromHex("01020304050607080102040810203040") tid, _ := apitrace.IDFromHex("01020304050607080102040810203040")
sid, _ := apitrace.SpanIDFromHex("0102040810203040") sid, _ := apitrace.SpanIDFromHex("0102040810203040")
return apitrace.SpanContext{ return apitrace.SpanContext{
TraceID: tid, TraceID: tid,

View File

@ -133,7 +133,7 @@ func BenchmarkSpanWithAttributes_all_2x(b *testing.B) {
} }
func BenchmarkTraceID_DotString(b *testing.B) { func BenchmarkTraceID_DotString(b *testing.B) {
t, _ := apitrace.TraceIDFromHex("0000000000000001000000000000002a") t, _ := apitrace.IDFromHex("0000000000000001000000000000002a")
sc := apitrace.SpanContext{TraceID: t} sc := apitrace.SpanContext{TraceID: t}
want := "0000000000000001000000000000002a" want := "0000000000000001000000000000002a"

View File

@ -41,10 +41,10 @@ func (gen *defaultIDGenerator) NewSpanID() trace.SpanID {
// NewTraceID returns a non-zero trace ID from a randomly-chosen sequence. // NewTraceID returns a non-zero trace ID from a randomly-chosen sequence.
// mu should be held while this function is called. // mu should be held while this function is called.
func (gen *defaultIDGenerator) NewTraceID() trace.TraceID { func (gen *defaultIDGenerator) NewTraceID() trace.ID {
gen.Lock() gen.Lock()
defer gen.Unlock() defer gen.Unlock()
tid := trace.TraceID{} tid := trace.ID{}
gen.randSource.Read(tid[:]) gen.randSource.Read(tid[:])
return tid return tid
} }

View File

@ -21,6 +21,6 @@ import (
// IDGenerator allows custom generators for TraceId and SpanId. // IDGenerator allows custom generators for TraceId and SpanId.
type IDGenerator interface { type IDGenerator interface {
NewTraceID() trace.TraceID NewTraceID() trace.ID
NewSpanID() trace.SpanID NewSpanID() trace.SpanID
} }

View File

@ -31,7 +31,7 @@ type Sampler interface {
// SamplingParameters contains the values passed to a Sampler. // SamplingParameters contains the values passed to a Sampler.
type SamplingParameters struct { type SamplingParameters struct {
ParentContext api.SpanContext ParentContext api.SpanContext
TraceID api.TraceID TraceID api.ID
SpanID api.SpanID SpanID api.SpanID
Name string Name string
HasRemoteParent bool HasRemoteParent bool

View File

@ -24,7 +24,7 @@ import (
func TestAlwaysParentSampleWithParentSampled(t *testing.T) { func TestAlwaysParentSampleWithParentSampled(t *testing.T) {
sampler := sdktrace.AlwaysParentSample() sampler := sdktrace.AlwaysParentSample()
traceID, _ := trace.TraceIDFromHex("4bf92f3577b34da6a3ce929d0e0e4736") traceID, _ := trace.IDFromHex("4bf92f3577b34da6a3ce929d0e0e4736")
spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7") spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7")
parentCtx := trace.SpanContext{ parentCtx := trace.SpanContext{
TraceID: traceID, TraceID: traceID,
@ -38,7 +38,7 @@ func TestAlwaysParentSampleWithParentSampled(t *testing.T) {
func TestAlwaysParentSampleWithParentNotSampled(t *testing.T) { func TestAlwaysParentSampleWithParentNotSampled(t *testing.T) {
sampler := sdktrace.AlwaysParentSample() sampler := sdktrace.AlwaysParentSample()
traceID, _ := trace.TraceIDFromHex("4bf92f3577b34da6a3ce929d0e0e4736") traceID, _ := trace.IDFromHex("4bf92f3577b34da6a3ce929d0e0e4736")
spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7") spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7")
parentCtx := trace.SpanContext{ parentCtx := trace.SpanContext{
TraceID: traceID, TraceID: traceID,

View File

@ -57,7 +57,7 @@ func TestSimpleSpanProcessorOnEnd(t *testing.T) {
tp.RegisterSpanProcessor(ssp) tp.RegisterSpanProcessor(ssp)
tr := tp.Tracer("SimpleSpanProcessor") tr := tp.Tracer("SimpleSpanProcessor")
tid, _ := apitrace.TraceIDFromHex("01020304050607080102040810203040") tid, _ := apitrace.IDFromHex("01020304050607080102040810203040")
sid, _ := apitrace.SpanIDFromHex("0102040810203040") sid, _ := apitrace.SpanIDFromHex("0102040810203040")
sc := apitrace.SpanContext{ sc := apitrace.SpanContext{
TraceID: tid, TraceID: tid,

View File

@ -38,12 +38,12 @@ import (
) )
var ( var (
tid apitrace.TraceID tid apitrace.ID
sid apitrace.SpanID sid apitrace.SpanID
) )
func init() { func init() {
tid, _ = apitrace.TraceIDFromHex("01020304050607080102040810203040") tid, _ = apitrace.IDFromHex("01020304050607080102040810203040")
sid, _ = apitrace.SpanIDFromHex("0102040810203040") sid, _ = apitrace.SpanIDFromHex("0102040810203040")
} }
@ -469,8 +469,8 @@ func TestLinks(t *testing.T) {
k2v2 := key.New("key2").String("value2") k2v2 := key.New("key2").String("value2")
k3v3 := key.New("key3").String("value3") k3v3 := key.New("key3").String("value3")
sc1 := apitrace.SpanContext{TraceID: apitrace.TraceID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}} sc1 := apitrace.SpanContext{TraceID: apitrace.ID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}}
sc2 := apitrace.SpanContext{TraceID: apitrace.TraceID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}} sc2 := apitrace.SpanContext{TraceID: apitrace.ID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}}
span := startSpan(tp, "Links", span := startSpan(tp, "Links",
apitrace.LinkedTo(sc1, key.New("key1").String("value1")), apitrace.LinkedTo(sc1, key.New("key1").String("value1")),
@ -508,9 +508,9 @@ func TestLinksOverLimit(t *testing.T) {
te := &testExporter{} te := &testExporter{}
cfg := Config{MaxLinksPerSpan: 2} cfg := Config{MaxLinksPerSpan: 2}
sc1 := apitrace.SpanContext{TraceID: apitrace.TraceID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}} sc1 := apitrace.SpanContext{TraceID: apitrace.ID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}}
sc2 := apitrace.SpanContext{TraceID: apitrace.TraceID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}} sc2 := apitrace.SpanContext{TraceID: apitrace.ID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}}
sc3 := apitrace.SpanContext{TraceID: apitrace.TraceID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}} sc3 := apitrace.SpanContext{TraceID: apitrace.ID([16]byte{1, 1}), SpanID: apitrace.SpanID{3}}
tp, _ := NewProvider(WithConfig(cfg), WithSyncer(te)) tp, _ := NewProvider(WithConfig(cfg), WithSyncer(te))
@ -833,7 +833,7 @@ func TestExecutionTracerTaskEnd(t *testing.T) {
s.executionTracerTaskEnd = executionTracerTaskEnd s.executionTracerTaskEnd = executionTracerTaskEnd
spans = append(spans, s) // never sample spans = append(spans, s) // never sample
tID, _ := apitrace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f") tID, _ := apitrace.IDFromHex("0102030405060708090a0b0c0d0e0f")
sID, _ := apitrace.SpanIDFromHex("0001020304050607") sID, _ := apitrace.SpanIDFromHex("0001020304050607")
ctx := context.Background() ctx := context.Background()