Skip to content

Commit

Permalink
Merge d5112c6 into 7650f35
Browse files Browse the repository at this point in the history
  • Loading branch information
little-cui committed Apr 10, 2018
2 parents 7650f35 + d5112c6 commit ba7f155
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/plugin/infra/tracing/buildin/span.go
Expand Up @@ -61,7 +61,9 @@ type Endpoint struct {
func (s *Span) FromZipkinSpan(span *zipkincore.Span) {
traceId := new(types.TraceID)
traceId.Low = uint64(span.TraceID)
traceId.High = uint64(*(span.TraceIDHigh))
if span.TraceIDHigh != nil {
traceId.High = uint64(*(span.TraceIDHigh))
}
s.TraceID = traceId.ToHex()
s.Duration = span.Duration

Expand Down
8 changes: 8 additions & 0 deletions server/plugin/infra/tracing/buildin/span_test.go
Expand Up @@ -158,4 +158,12 @@ func TestFromZipkinSpan(t *testing.T) {
t.FailNow()
}
fmt.Println(string(b))

s = FromZipkinSpan(&zipkincore.Span{})
b, err = json.Marshal(s)
if err != nil {
fmt.Println("TestFromZipkinSpan Marshal", err)
t.FailNow()
}
fmt.Println(string(b))
}

0 comments on commit ba7f155

Please sign in to comment.