Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Won Jun Jang <wjang@uber.com>
  • Loading branch information
black-adder committed Dec 4, 2017
1 parent 264f056 commit 5c7a4c2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions model/converter/json/from_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,19 @@ func (fd fromDomain) convertReferences(span *model.Span, preserveParentID bool)
out := make([]json.Reference, 0, length)
var parentRefAdded bool
for _, ref := range span.References {
newRef := json.Reference{
out = append(out, json.Reference{
RefType: fd.convertRefType(ref.RefType),
TraceID: json.TraceID(ref.TraceID.String()),
SpanID: json.SpanID(ref.SpanID.String()),
}
out = append(out, newRef)
if newRef.TraceID == json.TraceID(span.TraceID.String()) &&
newRef.SpanID == json.SpanID(span.ParentSpanID.String()) {
})
if ref.TraceID == span.TraceID && ref.SpanID == span.ParentSpanID {
// Check if the parent reference already exists
parentRefAdded = true
}
}
if span.ParentSpanID != 0 && !preserveParentID && !parentRefAdded {
// TODO this (wrongly) assumes that the reference type is always ChildOf
// By this point, if ParentSpanID != 0 but there are no other references,
// then the ParentSpanID does refer to child-of type
out = append(out, json.Reference{
RefType: json.ChildOf,
TraceID: json.TraceID(span.TraceID.String()),
Expand Down

0 comments on commit 5c7a4c2

Please sign in to comment.