Skip to content

Commit ef0d049

Browse files
Address #337
1 parent f37a973 commit ef0d049

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

spec/20-http_header_format.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,19 @@ trace-flags = 2HEXDIGLC ; 8 bit flags. Currently, only one bit is used. S
102102

103103
This is the ID of the whole trace forest and is used to uniquely identify a [distributed trace](https://w3c.github.io/trace-context/#dfn-distributed-traces) through a system. It is represented as a 16-byte array, for example, `4bf92f3577b34da6a3ce929d0e0e4736`. All bytes as zero (`00000000000000000000000000000000`) is considered an invalid value.
104104

105-
106105
A vendor SHOULD generate globally unique values for `trace-id`. Many unique identification generation algorithms create IDs where one part of the value is constant (often time- or host-based), and the other part is a randomly generated value. Because tracing systems may make sampling decisions based on the value of `trace-id`, for increased interoperability vendors MUST keep the random part of `trace-id` ID on the left side.
107106

108-
109-
When a system operates with a `trace-id` that is shorter than 16 bytes, it SHOULD fill-in the extra bytes with random values rather than zeroes. Let's say the system works with an 8-byte `trace-id` like `3ce929d0e0e4736`. Instead of setting `trace-id` value to `0000000000000003ce929d0e0e4736` it SHOULD generate a value like `4bf92f3577b34da6a3ce929d0e0e4736` where `4bf92f3577b34da6a` is a random value or a function of time and host value.
110-
107+
When a system operates with a `trace-id` that is shorter than 16 bytes, on new
108+
trace-id generation it SHOULD fill-in the extra bytes with random values rather
109+
than zeroes. Let's say the system works with an 8-byte `trace-id` like
110+
`23ce929d0e0e4736`. Instead of setting `trace-id` value to
111+
`23ce929d0e0e47360000000000000000` (note, that random part is kept on the left
112+
side as mentioned one paragraph above) it SHOULD generate a value like
113+
`4bf92f3577b34da623ce929d0e0e4736` where `4bf92f3577b34da6` is a random value or
114+
a function of time and host value. Note, that on receiving a `trace-id` which is
115+
longer than what system operates with, even though `trace-id` may be recorded
116+
with the shorter id, the entire trace-id needs to be propagated to the
117+
downstream components.
111118

112119
**Note**: Even though a system may operate with a shorter `trace-id` for [distributed trace](https://w3c.github.io/trace-context/#dfn-distributed-traces) reporting, the full `trace-id` MUST be propagated to conform to the specification.
113120

0 commit comments

Comments
 (0)