-
Notifications
You must be signed in to change notification settings - Fork 896
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
Move isRemote from SpanContext to Span #1086
Comments
We will lose the information whether a span has a remote parent then (which is currently available to exporters via the parent SpanContext in each span), which is IMHO one of the most important uses of the IsRemote flag. |
Thinking about it a bit more, I really don't think we should do this: IsRemote does basically say: "Was this span ID generated by this SDK?" and so it should be stored next to the Span ID and not be easily separated from it. E.g. what happens when you put a SpanContext from some span into a propagated span? The IsRemote should be preserved IMHO. |
I suggested moving it to Span, not removing it. Is there a functional difference? For reference, I wasn't able to use the new propagated span concept, since currently the concept of propagation is in the SpanContext, not the Span. It makes propagated span awkward - there's nothing special about a propagated span. |
Yes, I listed some in my comments. 😃 Maybe one more concrete example: Today you can have a propagated span with IsRemote=false by doing |
@Oberon00 Yeah - what does it mean for a propagated span to have a non-remote span context? I thought by definition that's not a propagated span. That confusion brought up the topic for me. |
It means that you can rely on the Span ID having been generated by a trusted ID generator, e.g. you can rely on it being an uniform random integer number instead of an incremented integer counter. EDIT: It also means that the tracestate really applies directly to this span(context) as opposed to a parent span of it. |
How does propagated span present this though? Is the expectation to do If we rename |
I'm not sure what you mean here? |
Yeah so that's seeing whether it's remote or not by accessing the |
I think the crux of my confusion is that PropagatedSpan is a type named after how it's used, not what it does it seems - I was expecting it to have some direct relationship with propagation. We'd usually name a type by what it does, since we don't know how it's used in practice - a span could be created, but maybe not propagated for whatever reason for example. |
I think the naming is really a bit unfortunate. Maybe PropagateOnlySpan would be better since it can only be used to propagate (a SpanContext) not to record anything. Or NonRecordingSpan. |
from the spec sig mtg today, sounds like there could be a separate issue for editorial change on clarification on |
@Oberon00 I was confused by this statement:
I guess the part that confuses me is the "parent span of it." Are you thinking of the PropagatedSpan instance as the "parent" in the sense that it reflects a remote Span? I would expect the tracestate of an I came into this discussion thinking, as I suspect @anuraaga did, that In the discussion above, it looks like some of us have been thinking of a PropagatedSpan as something like NoopSpan with real but non-recorded span identifiers, in that case the |
OK, that is confusing. I guess what I really need is an IsExtracted property (which is currently exactly equivalent to IsRemote). The use case we currently use IsRemote for: We inject a copy of the span ID into the traestate like Without IsRemote, we would not be able to implement this: The tracestate is copied to every child span, but it is only meaningful for the "local root" span, the one with a remote parent, as there is no mechanism in the default SDK to update the tracestate for local child spans (I guess you could use the sampler since #988, but there you also would need to have IsRemote as input to decide what to do). I don't have a use case for distinguishing otherwise non-propagated from propagated spans. |
from the spec SIG (APAC) we agreed that this issue can be closed. the SpanContext concept is conceptually the part of a Span that you can read, so wherever the span's identifiers go, that is where the "is remote" concept goes. |
I thought |
Now that we have
PropagatedSpan
in the spec,SpanContext.isRemote
seems redundant. In practice, it would be difficult to prevent creation of aPropagatedSpan
with a non-remoteSpanContext
for example. Does it make sense to moveisRemote
intoSpan
, where it returns true only forPropagatedSpan
?The text was updated successfully, but these errors were encountered: