You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current version of this specification (`00`) only supports a single flag called `sampled`.
142
-
143
141
When set, the least significant bit (right-most), denotes that the caller may have recorded trace data. When unset, the caller did not record trace data out-of-band.
144
142
145
143
There are a number of recording scenarios that may break distributed tracing:
@@ -176,6 +174,28 @@ There are two additional options that vendors MAY follow:
176
174
- A component that makes a deferred or delayed recording decision may communicate the priority of a recording by setting `sampled` flag to `1` for a subset of requests.
177
175
- A component may also fall back to probability sampling and set the `sampled` flag to `1` for the subset of requests.
178
176
177
+
##### Random Trace ID Flag
178
+
179
+
<!--
180
+
181
+
TODO: how many random bytes are needed?
182
+
7 was chosen as it can be efficiently represented as a 64-bit signed or unsigned integer.
183
+
8 would require an unsigned long which is not supported by some languages (like Java).
184
+
63 bits would be possible, but would require a more complex description that may be more difficult to understand.
185
+
186
+
TODO: Which specific bytes should be random?
187
+
The least significant bytes were chosen because some tracing systems are known to use the most significant
188
+
portion of the trace id for non-random data such as a timestamp component.
189
+
190
+
TODO: Do we want to place any restrictions on the randomness or is saying "MUST be random" enough?
191
+
As an example, RFC4122 (UUID v4) simply states "Set all the other bits to randomly (or pseudo-randomly) chosen values."
When set, the second least significant bit (second from the right), denotes that the least significant (right-most) 7 bytes of the trace ID MUST be random (or pseudo-random).
197
+
When unset, the trace ID may be generated in any way that satisfies the requirements of the [trace ID format](#trace-id).
198
+
179
199
##### Other Flags
180
200
181
201
The behavior of other flags, such as (`00000100`) is not defined and is reserved for future use. Vendors MUST set those to zero.
0 commit comments