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

DDG should support client root span #546

Closed
cykl opened this issue Mar 18, 2020 · 2 comments
Closed

DDG should support client root span #546

cykl opened this issue Mar 18, 2020 · 2 comments

Comments

@cykl
Copy link

cykl commented Mar 18, 2020

Requirement - what kind of business use case are you trying to solve?

I want to display the DDG of a trace started by a batch job.

Problem - what in Jaeger blocks you from solving the requirement?

Root spans of traces started by batch job are often client spans, ie. span.kind = client, but current DDG implementation requires a server root span. If this condition is not fulfilled DDG is not shown and an error message is displayed: There are no dependencies. No traces were found that contain client and any other service where span.kind is ‘server’.

I believe client root span ares valid use cases and should be supported.

Minimal test case

Following code produces a trace matching my issue:

import io.jaegertracing.internal.JaegerTracer;
import io.jaegertracing.internal.reporters.RemoteReporter;
import io.jaegertracing.internal.samplers.ConstSampler;
import io.jaegertracing.thrift.internal.senders.UdpSender;
import io.opentracing.Tracer;
import io.opentracing.tag.Tags;

public class ClientRootSpan {

    public static void main( String[ ] args ) throws InterruptedException {
        try (var clientTracer = createTracer( "client" )) {
            var clientSpan = clientTracer.buildSpan( "GET" )
                    .withTag( Tags.SPAN_KIND, "client" )
                    .withTag( Tags.HTTP_METHOD, "GET" )
                    .start( );

            Thread.sleep( 100 );

            try (var serverTracer = createTracer( "server" )) {
                var serverSpan = serverTracer.buildSpan( "GET" )
                        .asChildOf( clientSpan )
                        .withTag( Tags.SPAN_KIND, "server" )
                        .withTag( Tags.HTTP_METHOD, "GET" )
                        .start( );

                Thread.sleep( 50 );
                serverSpan.finish( );
            }

            clientSpan.finish( );
        }
    }

    static Tracer createTracer( String serviceName ) {
        return new JaegerTracer.Builder( serviceName )
                .withSampler( new ConstSampler( true ) )
                .withReporter( new RemoteReporter.Builder( ).withSender( new UdpSender( ) ).build( ) )
                .build( );
    }
}

Trace is properly displayed in timeline and graph view:

image

image

However, DDG generation fails:

image

Any open questions to address

  • Current implementation also don't support messaging scenario, ie. producer / consumer. It's not directly related to this issue so I will fill a separate one.
  • I would be great if the Jaeger team could document how Jaeger compute dependencies. DDG, Spark and Flink jobs seams to all behave slightly differently and several comments on this topic remained unanswered or seems to be saying the OSS and Uber version works quite differently, ex. Fix search results DDG path ordering #504 (comment) or question about DeepDependencyGraph  #454 (comment).
@everett980
Copy link
Collaborator

I believe this use case was addressed by Ruben's work in PR#557. Please re-open with more information if I am mistaken.

@cykl
Copy link
Author

cykl commented Apr 28, 2020

I just tested latest revision and confirm that #557 solves this issue. Thanks!

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

No branches or pull requests

2 participants