Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit e2ce75a

Browse files
Douglas GreimanBogdan Drutu
authored andcommitted
Make example field values match (#3)
* Make example field values match Also add all 0's byte to example, to make it clear that single bytes are allowed to be 0. * Remove endianness and int64/int128 discussion. * Restore "e." that got chopped off during reformatting.
1 parent 2c805c0 commit e2ce75a

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

encodings/BinaryEncoding.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ were received) or until the first unknown field_id.
4444

4545
### How can we add new fields?
4646
If we follow the rules that we always append the new ids at the end of the buffer we can add up
47-
to 127.
47+
to 127.
4848

4949
TODO(bdrutu): Decide what to do after 127: a) use varint encoding or b) just reserve 255 as a
5050
continuation byte.
@@ -60,16 +60,16 @@ and use the default values.
6060
* `field_id` = 0
6161
* `len` = 16
6262

63-
Is the ID of the whole trace forest. It is represented as a 16-bytes array,
64-
e.g. (in hex), `4bf92f3577b34da6a3ce929d0e0e4736`. All bytes 0 is considered invalid.
63+
Is the ID of the whole trace forest. It is represented as an opaque 16-bytes array,
64+
e.g. (in hex), `4bf92f3577b34da6a3ce929d000e4736`. All bytes 0 is considered invalid.
6565

6666
#### Span-id
6767

6868
* `field_id` = 1
6969
* `len` = 8
7070

71-
Is the ID of the caller span (parent). It is represented as a 8-bytes array,
72-
e.g. (in hex), `00f067aa0ba902b7`. All bytes 0 is considered invalid.
71+
Is the ID of the caller span (parent). It is represented as an opaque 8-bytes array,
72+
e.g. (in hex), `34f067aa0ba902b7`. All bytes 0 is considered invalid.
7373

7474
#### Trace-options
7575

@@ -90,15 +90,17 @@ caller rather than strict rules to follow for 3 reasons:
9090
The behavior of other bits is currently undefined.
9191

9292
#### Valid example
93-
{0, 0, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 1, 97, 98, 99, 100, 101,
94-
102, 103, 104, 2, 1}
93+
{0,
94+
0, 75, 249, 47, 53, 119, 179, 77, 166, 163, 206, 146, 157, 0, 14, 71, 54,
95+
1, 52, 240, 103, 170, 11, 169, 2, 183,
96+
2, 1}
9597

9698
This corresponds to:
97-
* `traceId` = {64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79}
98-
* `spanId` = {97, 98, 99, 100, 101, 102, 103, 104}
99+
* `traceId` = {75, 249, 47, 53, 119, 179, 77, 166, 163, 206, 146, 157, 0, 14, 71, 54}
100+
* `spanId` = {52, 240, 103, 170, 11, 169, 2, 183}
99101
* `traceOptions` = 1
100102

101103
## Related Work
102104
* [TraceContext Project](https://github.com/TraceContext/tracecontext-spec)
103105
* [Stackdriver TraceContext Header](https://cloud.google.com/trace/docs/support)
104-
* [B3 TraceContext Header](https://github.com/openzipkin/b3-propagation)
106+
* [B3 TraceContext Header](https://github.com/openzipkin/b3-propagation)

0 commit comments

Comments
 (0)