@@ -48,8 +48,10 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData {
4848 var out []* SpanData
4949 s .mu .Lock ()
5050 defer s .mu .Unlock ()
51- for span := range s .active {
52- out = append (out , span .makeSpanData ())
51+ for activeSpan := range s .active {
52+ if s , ok := activeSpan .(* span ); ok {
53+ out = append (out , s .makeSpanData ())
54+ }
5355 }
5456 return out
5557}
@@ -185,7 +187,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t
185187// bucketed by latency.
186188type spanStore struct {
187189 mu sync.Mutex // protects everything below.
188- active map [* Span ]struct {}
190+ active map [Span ]struct {}
189191 errors map [int32 ]* bucket
190192 latency []bucket
191193 maxSpansPerErrorBucket int
@@ -194,7 +196,7 @@ type spanStore struct {
194196// newSpanStore creates a span store.
195197func newSpanStore (name string , latencyBucketSize int , errorBucketSize int ) * spanStore {
196198 s := & spanStore {
197- active : make (map [* Span ]struct {}),
199+ active : make (map [Span ]struct {}),
198200 latency : make ([]bucket , len (defaultLatencies )+ 1 ),
199201 maxSpansPerErrorBucket : errorBucketSize ,
200202 }
@@ -271,15 +273,15 @@ func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) {
271273}
272274
273275// add adds a span to the active bucket of the spanStore.
274- func (s * spanStore ) add (span * Span ) {
276+ func (s * spanStore ) add (span Span ) {
275277 s .mu .Lock ()
276278 s .active [span ] = struct {}{}
277279 s .mu .Unlock ()
278280}
279281
280282// finished removes a span from the active set, and adds a corresponding
281283// SpanData to a latency or error bucket.
282- func (s * spanStore ) finished (span * Span , sd * SpanData ) {
284+ func (s * spanStore ) finished (span Span , sd * SpanData ) {
283285 latency := sd .EndTime .Sub (sd .StartTime )
284286 if latency < 0 {
285287 latency = 0
0 commit comments