-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix issue where Domain to UI model converter double reports the same … #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,19 +97,26 @@ func (fd fromDomain) convertReferences(span *model.Span, preserveParentID bool) | |
| length++ | ||
| } | ||
| out := make([]json.Reference, 0, length) | ||
| if span.ParentSpanID != 0 && !preserveParentID { | ||
| out = append(out, json.Reference{ | ||
| RefType: json.ChildOf, | ||
| TraceID: json.TraceID(span.TraceID.String()), | ||
| SpanID: json.SpanID(span.ParentSpanID.String()), | ||
| }) | ||
| } | ||
| var parentRefAdded bool | ||
| for _, ref := range span.References { | ||
| out = append(out, json.Reference{ | ||
| RefType: fd.convertRefType(ref.RefType), | ||
| TraceID: json.TraceID(ref.TraceID.String()), | ||
| SpanID: json.SpanID(ref.SpanID.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 { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not directly related to this diff, but I see that the only time
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't recall the exact reason but it probably has to do with keeping the es schema the same as the zipkin one. |
||
| // 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()), | ||
| SpanID: json.SpanID(span.ParentSpanID.String()), | ||
| }) | ||
| } | ||
| return out | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this comment explains anything, maybe remove it?