11package tracer
22
33import (
4+ "github.com/google/uuid"
45 "reflect"
56 "strconv"
67 "testing"
@@ -15,7 +16,7 @@ func TestSpan_Baggage(t *testing.T) {
1516 recorder := NewInMemoryRecorder ()
1617 tracer := NewWithOptions (Options {
1718 Recorder : recorder ,
18- ShouldSample : func (traceID uint64 ) bool { return true }, // always sample
19+ ShouldSample : func (traceID uuid. UUID ) bool { return true }, // always sample
1920 })
2021 span := tracer .StartSpan ("x" )
2122 span .SetBaggageItem ("x" , "y" )
@@ -52,7 +53,7 @@ func TestSpan_Sampling(t *testing.T) {
5253 recorder := NewInMemoryRecorder ()
5354 tracer := NewWithOptions (Options {
5455 Recorder : recorder ,
55- ShouldSample : func (traceID uint64 ) bool { return true },
56+ ShouldSample : func (traceID uuid. UUID ) bool { return true },
5657 })
5758 span := tracer .StartSpan ("x" )
5859 span .Finish ()
@@ -66,7 +67,7 @@ func TestSpan_Sampling(t *testing.T) {
6667
6768 tracer = NewWithOptions (Options {
6869 Recorder : recorder ,
69- ShouldSample : func (traceID uint64 ) bool { return false },
70+ ShouldSample : func (traceID uuid. UUID ) bool { return false },
7071 })
7172
7273 recorder .Reset ()
@@ -85,7 +86,7 @@ func TestSpan_SingleLoggedTaggedSpan(t *testing.T) {
8586 recorder := NewInMemoryRecorder ()
8687 tracer := NewWithOptions (Options {
8788 Recorder : recorder ,
88- ShouldSample : func (traceID uint64 ) bool { return true }, // always sample
89+ ShouldSample : func (traceID uuid. UUID ) bool { return true }, // always sample
8990 })
9091 span := tracer .StartSpan ("x" )
9192 span .LogEventWithPayload ("event" , "payload" )
@@ -112,7 +113,7 @@ func TestSpan_TrimUnsampledSpans(t *testing.T) {
112113 // Tracer that trims only unsampled but always samples
113114 tracer := NewWithOptions (Options {
114115 Recorder : recorder ,
115- ShouldSample : func (traceID uint64 ) bool { return true }, // always sample
116+ ShouldSample : func (traceID uuid. UUID ) bool { return true }, // always sample
116117 TrimUnsampledSpans : true ,
117118 })
118119
@@ -133,7 +134,7 @@ func TestSpan_TrimUnsampledSpans(t *testing.T) {
133134 // Tracer that trims only unsampled and never samples
134135 tracer = NewWithOptions (Options {
135136 Recorder : recorder ,
136- ShouldSample : func (traceID uint64 ) bool { return false }, // never sample
137+ ShouldSample : func (traceID uuid. UUID ) bool { return false }, // never sample
137138 TrimUnsampledSpans : true ,
138139 })
139140
@@ -152,7 +153,7 @@ func TestSpan_DropAllLogs(t *testing.T) {
152153 // Tracer that drops logs
153154 tracer := NewWithOptions (Options {
154155 Recorder : recorder ,
155- ShouldSample : func (traceID uint64 ) bool { return true }, // always sample
156+ ShouldSample : func (traceID uuid. UUID ) bool { return true }, // always sample
156157 DropAllLogs : true ,
157158 })
158159
@@ -175,7 +176,7 @@ func TestSpan_MaxLogSperSpan(t *testing.T) {
175176 // Tracer that only retains the last <limit> logs.
176177 tracer := NewWithOptions (Options {
177178 Recorder : recorder ,
178- ShouldSample : func (traceID uint64 ) bool { return true }, // always sample
179+ ShouldSample : func (traceID uuid. UUID ) bool { return true }, // always sample
179180 MaxLogsPerSpan : limit ,
180181 })
181182
0 commit comments