-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Introduce ParentReference adjuster #3786
Introduce ParentReference adjuster #3786
Conversation
215cce0
to
816f274
Compare
Codecov Report
@@ Coverage Diff @@
## main #3786 +/- ##
==========================================
+ Coverage 97.58% 97.59% +0.01%
==========================================
Files 288 289 +1
Lines 16778 16800 +22
==========================================
+ Hits 16372 16396 +24
+ Misses 321 319 -2
Partials 85 85
Continue to review full report at Codecov.
|
model/adjuster/sort_references.go
Outdated
sort.SliceStable(span.References, func(i, j int) bool { | ||
iType := span.References[i].GetRefType() | ||
jType := span.References[j].GetRefType() | ||
return iType == model.SpanRefType_CHILD_OF && jType == model.SpanRefType_FOLLOWS_FROM |
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.
I don't think this is a sufficient condition. The logic to pick the correct parent should be:
- first ref with refType=CHILD_OF and the same trace ID
- otherwise, first ref that has the same trace ID
- otherwise no change
Also, I would avoid the actual sorting, and only do the swap into the first position.
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.
Makes sense, updated.
816f274
to
0db7af1
Compare
As demonstrated in /~https://github.com/jaegertracing/jaeger-ui/issues/966, jaeger-ui expects the first reference to be of `CHILD_OF` type to properly render the tree. This new adjuster achieves exactly that. Signed-off-by: Ivan Babrou <github@ivan.computer>
0db7af1
to
119210c
Compare
Signed-off-by: Yuri Shkuro <github@ysh.us>
* Introduce ParentReference adjuster As demonstrated in /~https://github.com/jaegertracing/jaeger-ui/issues/966, jaeger-ui expects the first reference to be of `CHILD_OF` type to properly render the tree. This new adjuster achieves exactly that. Signed-off-by: Ivan Babrou <github@ivan.computer> * Simplify algorithm, clean-up tests Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <github@ysh.us> Signed-off-by: Albert Teoh <see.kwang.teoh@gmail.com>
As demonstrated in /~https://github.com/jaegertracing/jaeger-ui/issues/966, jaeger-ui expects the first reference to be of
CHILD_OF
type to properly render the tree. This new adjuster achieves exactly that.Resolves #3785