-
Notifications
You must be signed in to change notification settings - Fork 76
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
Trace Context Extensibility #573
Comments
Proposal 4: Trace State for new persistent fields
This opens up the possibility to use Advantages:
Concerns:
Proposal 4 part 2: combine proposal 4 and 1This is similar to (3) however instead of new fields in the Proposal 5: do nothingThis is here for completeness, however I do not feel we should take this option. We do have the option to do nothing, and to rely on the semantics we already have. This would mean new flags or fields that should be persisted for the whole trace (like the random flag) require all trace participants to be updated before it can be assured that the flag or field is persisted. Flags and fields which only describe a single trace participant would work fine in this scenario. |
how about Proposal 0: rollback the rule "it is required to set those flags to 0". It was clearly an oversight, and while rolling it back does not solve the immediate problem, it future-proofs the spec. |
Proposal 0: Roll back set-0 requirementThis proposal is to roll back the rule requiring unknown flags to be set to |
My argument would be that this is a false use case. This refers to information that only makes sense in a single hop, which can be sent via multitude of other ways, not via trace context that is meant to make sense across the whole distributed workflow (and therefore is optimized for repeated transmission, whereas one-hop data can afford to spend a few more bytes). You would have the same problem if we did not have bitmap in the context at all and you tried to send this "I am a browser" signal via |
The sampling bit is an example of this. It is propagated, but it is meant to describe only the parent. It could be flipped to |
Question: can anyone think of a bit that would be harmful if propagated through the full trace by out-of-date participants? |
Thanks @dyladan for putting together this summary! Here are my current thoughts/questions:
|
I see the value of Proposal 1 and 4. Not sure about 2 -- I'm not aware of what, if any, other flags or fields may be under consideration. There is an argument that the Sampled flag is appropriately characterized as a claim about the single hop, and I agree the Random flag doesn't qualify. Proposal 6Introduce a new 8-bit field for flags that are designed as claims about the trace and defined to propagate, even the unknown flags. That would add 3 bytes to the traceparent. A new propagating Random flag could be introduced in the new field with appropriate semantics, and this leaves 6 bits in trace flags. This would leave two random flags, an admittedly confusing situation, but as it stands today the Random flag can still be useful. In OpenTelemetry we have spoken about "Presumption of TraceID Randomness" which is to assert that when a TraceState value is not present, it is safe to assume the TraceID was random. This can be verified after the fact by checking whether, in fact, the root span has the 0x2 original random flag set. |
On a related note, open-telemetry/oteps#247 was a proposal in OpenTelemetry. If you are inserting details about yourself and mean them to propagate only once, then the TraceState field should not be automatically propagated. I wonder if there is an opportunity to define single-hop tracestate fields. |
There is no specified behavior for tracestate metadata but TTL has been discussed several times and been received favorably. It hasn't been implemented simply because there's not been anyone really pushing for it. |
We (@dyladan , @SergeyKanzhelev , and I) discussed this in the last DT working group meeting. Each of us felt that Proposal 4 (using tracestate) is the best way forward here. Here's our reasoning:
We want to invite further feedback on the above and if there are any counter-arguments for going with a different proposal than proposal 4. If so, please feel free to reply here, and/or join a W3C DT working group meeting (https://www.w3.org/groups/wg/distributed-tracing/calendar/). |
Currently (level 1, version specifier
00
), if a trace participant encounters trace flags it does not recognize it is required to set those flags to0
before forwarding the trace header. For example, atraceparent
with flags02
will result in flags set to00
before propagation. This was done in order to avoid a trace participant making claims that it doesn't know are true. For example, if a new flag is defined that means the agent is a browser, a server-side trace participant forwarding the flag blindly would also incorrectly and unknowingly claim that it itself is a browser agent.This causes a problem because in order to make use of any new flag which affects the whole trace, all participants in the trace must be updated to properly forward the flag. An example is the newly introduced random flag which claims that at least the right-most 7 bytes of the Trace ID are randomly random. Any participant in the trace which encounters this flag and has not yet been updated will set the flag to
0
even though it would still be correct for it to be1
. This causes a long delay in when a newly introduced flag is likely to be useful in complex orgs.Solution Proposal 1: propagation bit-mask
0
Example
00-0123456789012345-01234567-27
:This example assumes a trace participant only "understands" the least-significant bit (sampled flag). In this example, a trace participant would blindly propagate the second-least-significant bit (Flag 2, random bit), but not the third-least-significant bit (Flag 3) because the bit mask only identifies Flag 2 as a bit that should be blindly propagated.
Solution Proposal 2: New Field Identification
In the current specification, any new fields should be dropped if they are unknown to the trace participant. This solution proposes to amend that recommendation to the following:
1
, propagate the field unchanged0
Example:
00-0123456789012345-01234567-00-0123-FF00
In this example, fields 4 and 5 are both unknown to the trace participant. The participant set all fields in field 4 to
0
because the most significant bit of the field is0
, but the participant forwarded field 5 unchanged because the most significant field of the bit was1
.Proposal 3: Do both
I propose we adopt both of these new semantics for the next release of Trace Context. The bit-mask option cuts the number of possible flags to
4
(with 2 already taken, 2 are available), but improves future extensibility of the protocol. The new field identification proposal improves the prospects for extensibility in the future.The text was updated successfully, but these errors were encountered: