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

How to know a parent is remote when starting a span #187

Closed
tsloughter opened this issue Jul 20, 2019 · 3 comments · Fixed by #216
Closed

How to know a parent is remote when starting a span #187

tsloughter opened this issue Jul 20, 2019 · 3 comments · Fixed by #216
Assignees
Labels
area:sampling Related to trace sampling
Milestone

Comments

@tsloughter
Copy link
Member

Whether or not the parent of a span that is being started is remote is an attribute that must be passed to samplers.

Span creation docs do mention remote parents but it isn't clear how it is deciding it is remote:

tracer.StartSpan(options.WithNoParent(), options.WithParentContext(parentCtx)) will generate a new child span with remote parent parentCtx, and WithNoParent will be ignored.

Why is it assumed that parentCtx is remote here?

In OpenCensus we had a optional remote parent flag that could be set when calling start_span.

@tsloughter
Copy link
Member Author

Based on the Java implementation it does appear the decision is based on if the parent is a Span or SpanContext. This doesn't work well for at least the Erlang implementation where the user will only ever have the context for use as a parent.

I think there should be a explicit is parent or similar option.

@iredelmeier iredelmeier added the area:sampling Related to trace sampling label Jul 30, 2019
@mwear
Copy link
Member

mwear commented Aug 2, 2019

Typically, a SpanContext that has crossed a process boundary will have been extracted with a propagator. This could be solved by adding a boolean property to indicate that on the SpanContext. Possible names could be Is/WasRemote, Is/WasExtracted. Since SpanContext is a sealed class I assume this would require buy-in from the community and a change to the spec.

@tsloughter
Copy link
Member Author

@mwear yea, that is what OpenCensus did. For now I'm adding a is_remote to span context to move forward.

How to propose adding this officially to the SpanContext? Just a PR to update the spec or does it belong in an rfc first?

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

Successfully merging a pull request may close this issue.

4 participants