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

Why we need a root span? #48

Open
cuihaikuo opened this issue Nov 8, 2019 · 1 comment
Open

Why we need a root span? #48

cuihaikuo opened this issue Nov 8, 2019 · 1 comment

Comments

@cuihaikuo
Copy link

When build a request and call TraceRequest(), two spans will be recorded, a root span and a child span, so why we use two spans to trace one request?

@tonglil
Copy link

tonglil commented Mar 20, 2021

FWIW, this is what I see in Datadog, an empty HTTP_CLIENT root span that's not necessary:
image
image

Based on the code, I don't see where a root span could have been set other than in Tracer.start(req)

h.root = root

and AFAICT start only gets called once
tracer.start(req)

Was Tracer suppose to be initiated with a root span somehow but got missed

ht := &Tracer{tr: tr, opts: opts}

Like:

	ht := &Tracer{tr: tr, opts: opts, root: opentracing.SpanFromContext(req.Context())}

?

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