Skip to content
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

Fix FollowsFrom reference clock skew adjuster #460

Conversation

bogatuadrian
Copy link

As stated by @black-adder in #448, the clockskew adjuster does not handle spans that reference the parent span using FollowsFrom reference. This PR tries to fix that by considering spans that have that reference as root spans. This way, the span will not be adjusted (specifically will be adjusted with a skew with delta = 0).

Note: if you find the use of labels ugly, please comment and I will change it to the alternative approach.

A span that has a FollowsFrom reference to its parent should not be
clock-adjusted, therefore we can consider it as a root span when
building the spans subgraph in the clockskew adjuster.

Signed-off-by: Adrian Bogatu <bogatu.adrian@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 99.953% when pulling 11b4fd7 on bogatuadrian:fix-follows-from-clock-skew into d17fad0 on jaegertracing:master.

@bogatuadrian bogatuadrian force-pushed the fix-follows-from-clock-skew branch from 11b4fd7 to 33f03b0 Compare October 6, 2017 18:18
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 99.953% when pulling 33f03b0 on bogatuadrian:fix-follows-from-clock-skew into d17fad0 on jaegertracing:master.

@bogatuadrian bogatuadrian force-pushed the fix-follows-from-clock-skew branch from 33f03b0 to 6438d73 Compare October 8, 2017 14:48
Signed-off-by: Adrian Bogatu <bogatu.adrian@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 6438d73 on bogatuadrian:fix-follows-from-clock-skew into d17fad0 on jaegertracing:master.


// Treat spans that have a FOLLOWS_FROM reference to their parent as root spans.
for _, ref := range n.span.References {
if ref.RefType == model.FollowsFrom && ref.SpanID == n.span.ParentSpanID {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the References list has both ChildOf and FollowsFrom?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both referencing the parent? Well, first of all this should not happen, but if it does and there is at least one FollowsFrom to the parent I think the time should not be adjusted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first of all this should not happen

I don't know about that, there can be all kinds of DAGs people might want to model. My point is that the original implementation of the clock skew was ignoring the FollowsFrom altogether. If we want to support it properly, then the graph may need to be normalized better. I.e. it should be looking at all references, not just jump to a conclusion when we see one specific type. And it should not be relying on the parentId anywhere, only on references.

Parent ID is actually an optimization detail for the cases where there's a single ChildOf reference to that parent - the pattern occurs in the majority of spans, and representing it with a single ID is more efficient than with a ChildOf reference. But the processing should really be based on the references (which might require an enrichment step where add a ChildOf reference if we see parentId != 0 and len(references) == 0 - this is what we're doing before returning JSON to the UI, we could probably refactor the enrichment chain to do that before the clockskew).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we consider the span as a root iff all of its references are FOLLOWS_FROM? Otherwise, we only add it as a child for parents where there is a CHILD_OF relationship?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants