-
Notifications
You must be signed in to change notification settings - Fork 888
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
Randomness requirements following W3C Trace Context level 2 #4162
base: main
Are you sure you want to change the base?
Conversation
fa9ec4c
to
71750cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See nit comment about text formatting, for diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…ication into jmacd/sampling_new
Thanks Co-authored-by: Robert Pająk <pellared@hotmail.com> Co-authored-by: Kent Quirk <kentquirk@gmail.com>
…pecification into jmacd/sampling_new
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
…ication into jmacd/sampling_new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, LGTM, only a question about being more explicit in how SDKs can accept the randomness values set by API users.
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
…ication into jmacd/sampling_new
f0c68a3
to
140492b
Compare
Please take another look, this should be fixed :-)
…ication into jmacd/sampling_new
hexdigit = DIGIT ; a-f | ||
``` | ||
|
||
The explicit randomness value is meant to be used instead of extracting randomness from TraceIDs, therefore it contains the same number of bits as a W3C Trace Context Level 2 recommends for TraceIDs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explicit randomness value is meant to be used instead of extracting randomness from TraceIDs, therefore it contains the same number of bits as a W3C Trace Context Level 2 recommends for TraceIDs. | |
The explicit randomness value is meant to be used instead of extracting randomness from TraceIDs, therefore it contains the same number of bits as W3C Trace Context Level 2 recommends for TraceIDs. |
|
||
#### Explicit trace randomness | ||
|
||
For root span contexts, the when the SDK generates a TraceID that does not meet the [W3C Trace Context Level 2 randomness requirements][W3CCONTEXTTRACEID], and when the initial `TraceState` does not already define the [`rv` sub-key of the OpenTelemetry TraceState][OTELRVALUE], the SDK SHOULD insert an explicit trace randomness value into the OpenTelemetry TraceState value containing 56 random bits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For root span contexts, the when the SDK generates a TraceID that does not meet the [W3C Trace Context Level 2 randomness requirements][W3CCONTEXTTRACEID], and when the initial `TraceState` does not already define the [`rv` sub-key of the OpenTelemetry TraceState][OTELRVALUE], the SDK SHOULD insert an explicit trace randomness value into the OpenTelemetry TraceState value containing 56 random bits. | |
For root span contexts, when the SDK generates a TraceID that does not meet the [W3C Trace Context Level 2 randomness requirements][W3CCONTEXTTRACEID], and when the initial `TraceState` does not already define the [`rv` sub-key of the OpenTelemetry TraceState][OTELRVALUE], the SDK SHOULD insert an explicit trace randomness value into the OpenTelemetry TraceState value containing 56 random bits. |
|
||
The OTLP representation for Span and Span Link includes a 32-bit field declared as Span Flags. | ||
|
||
Bits 0-7 of the Span Flags field are reserved for the 8 bits of Trace Context flags, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bits 0-7 of the Span Flags field are reserved for the 8 bits of Trace Context flags, | |
Bits 0-7 (8 least significant bits) of the Span Flags field are reserved for the 8 bits of Trace Context flags, |
### Sampling Requirements | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doc is marked "stable except where otherwise specified", is this section intentionally going straight to stable?
@@ -530,6 +592,13 @@ public interface IdGenerator { | |||
} | |||
``` | |||
|
|||
Custom implementations of the `IdGenerator` SHOULD support setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
SHOULD support setting
it seems the SDK would be responsible to set the random flag based on some IdGenerator
property, and the IdGenerator
would only expose some information about itself.
|
||
#### Explicit trace randomness | ||
|
||
For root span contexts, the when the SDK generates a TraceID that does not meet the [W3C Trace Context Level 2 randomness requirements][W3CCONTEXTTRACEID], and when the initial `TraceState` does not already define the [`rv` sub-key of the OpenTelemetry TraceState][OTELRVALUE], the SDK SHOULD insert an explicit trace randomness value into the OpenTelemetry TraceState value containing 56 random bits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the SDK SHOULD insert an explicit trace randomness value into the OpenTelemetry TraceState
should it be an SDK responsibility? I assume that all OTel SDKs would (if not already) generate random trace-ids and rv
would only be needed when custom id generator is used.
The distro/application that uses custom generator can be responsible for setting rv
if they use non-random trace-ids and only if they need consistent sampling.
If we ask SDKs to do it, the concern is that at least initially, while most of systems don't support W3C Trace-Context level 2 and random flag, updated OTel SDKs will start generating rv
(and start widely using tracestate
).
Overall LGTM (once some of the latest feedback comments have been addressed). |
Changes
Updates Trace SDK and Propagator specifications with
Part of #1413.
Part of #3602.
Product of the Sampling SIG members @kentquirk @kalyanaj @oertl @PeterF778 and myself.
CHANGELOG.md
spec-compliance-matrix.md