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
This new version adds considerations for the generation of the `trace-id` and `span-id` fields, and adds the random trace ID flag.
2
+
3
+
As an exit criteria, the Working Group intends to demonstrate at least 2 implementations adopting this specification and making use of it, using a test suite.
Copy file name to clipboardExpand all lines: spec/20-http_request_header_format.md
+12-6
Original file line number
Diff line number
Diff line change
@@ -182,12 +182,18 @@ There are two additional options that vendors MAY follow:
182
182
183
183
##### Random Trace ID Flag
184
184
185
-
The second least significant bit of the trace-flags field denotes the random-trace-id flag.
186
-
If that flag is set, at least the right-most 7 bytes of the trace ID MUST be random (or pseudo-random).
187
-
If the flag is not set, the trace ID MAY still be randomly (or pseudo-randomly) generated.
188
-
When unset, the trace ID MAY be generated in any way that satisfies the requirements of the [trace ID format](#trace-id).
185
+
The second least significant bit of the trace-flags field denotes the `random-trace-id` flag.
186
+
187
+
When starting or restarting a trace (that is, when the participant generates a new `trace-id`), the following rules apply:
188
+
* If that flag is set, at least the right-most 7 bytes of the `trace-id` MUST be selected randomly (or pseudo-randomly) with uniform distribution over the interval [0..2^56-1].
189
+
* If the flag is not set, the `trace-id` MAY still be randomly (or pseudo-randomly) generated.
190
+
* When unset, the `trace-id` MAY be generated in any way that satisfies the requirements of the [trace ID format](#trace-id).
191
+
* When at least the right-most 7 bytes of the `trace-id` are randomly (or pseudo-randomly) generated, the `random-trace-id` flag SHOULD be set to `1`.
192
+
193
+
When continuing a trace (that is, the incoming HTTP request had the `traceparent` header and the participant uses the same `trace-id` in the `traceparent` header on outgoing requests), the following rules apply:
194
+
* If the flag is set in the incoming `traceparent` header, it MUST also be set in all outgoing `traceparent` headers which use the same `trace-id`.
195
+
* If the flag is unset in the incoming `traceparent` header, it MUST also be unset in any outgoing `traceparent` headers which use the same `trace-id`.
189
196
190
-
When at least the right-most 7 bytes of the `trace-id` are randomly (or pseudo-randomly) generated, the random trace ID flag SHOULD be set to `1`.
191
197
This allows downstream consumers to implement features such as trace sampling or database sharding based on these bytes.
192
198
For additional information, see [considerations for trace-id field generation](#considerations-for-trace-id-field-generation).
193
199
@@ -254,7 +260,7 @@ In order to increase interoperability across multiple protocols and encourage su
254
260
255
261
### tracestate Header Field Values
256
262
257
-
The `tracestate` field may contain any [=opaque=] value in any of the keys. Tracestate MAY be sent or received as multiple header fields. Multiple tracestate header fields MUST be handled as specified by <adata-cite='!RFC9110#field.order'>RFC9110 Section 5.3 Field Order</a>. The `tracestate` header SHOULD be sent as a single field when possible, but MAY be split into multiple header fields. When sending `tracestate` as multiple header fields, it MUST be split according to <adata-cite='!RFC9110#field.order'>RFC9110</a>. When receiving multiple `tracestate` header fields, they MUST be combined into a single header according to <adata-cite='!RFC9110#field.order'>RFC9110</a>.
263
+
The `tracestate` field may contain any [=opaque=] value in any of the keys. Tracestate MAY be sent or received as multiple header fields. Multiple tracestate header fields MUST be handled as specified by <adata-cite='!RFC9110#name-field-order'>RFC9110 Section 5.3 Field Order</a>. The `tracestate` header SHOULD be sent as a single field when possible, but MAY be split into multiple header fields. When sending `tracestate` as multiple header fields, it MUST be split according to <adata-cite='!RFC9110#name-field-order'>RFC9110</a>. When receiving multiple `tracestate` header fields, they MUST be combined into a single header according to <adata-cite='!RFC9110#name-field-order'>RFC9110</a>.
258
264
259
265
This section uses the Augmented Backus-Naur Form (ABNF) notation of [[!RFC5234]], including the DIGIT rule in <adata-cite='!RFC5234#appendix-B.1'>appendix B.1 for RFC5234</a>. It also includes the `OWS` rule from <adata-cite='!RFC9110#whitespace'>RFC9110 section 5.6.3</a>.
Thanks to Adrian Cole, Christoph Neumüller, Daniel Khan, Erika Arnold, Fabian Lange, Matthew Wear, Reiley Yang, Ted Young, Tyler Benson, Victor Soares for their contributions to this work.
3
+
Thanks to Adrian Cole, Christoph Neumüller, Daniel Khan, Erika Arnold, Fabian Lange, Matthew Wear, Philippe Le Hegaret, Reiley Yang, Ted Young, Tyler Benson, and Victor Soares for their contributions to this work.
0 commit comments