Skip to content

Commit 0f868b7

Browse files
docs: Add some clarity to ottrace docs (open-telemetry#522)
1 parent cc244b9 commit 0f868b7

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

propagator/ottrace/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ The `opentelemetry-propagator-ottrace` gem contains injectors and extractors for
77

88
| Header Name | Description | Required |
99
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
10-
| `ot-tracer-traceid` | uint64 encoded as a string of 16 hex characters | yes |
11-
| `ot-tracer-spanid` | uint64 encoded as a string of 16 hex characters | yes |
10+
| `ot-tracer-traceid` | 64-bit; 16 hex digits (extract and inject) or 128-bit; 32 hex digits (extract) | yes |
11+
| `ot-tracer-spanid` | 64-bit; 16 hex digits | yes |
1212
| `ot-tracer-sampled` | boolean or bit encoded as a string with the values `'true'`,`'false'`, `'1'`, or `'0'` | no |
1313
| `ot-baggage-*` | repeated string to string key-value baggage items; keys are prefixed with `ot-baggage-` and the corresponding value is the raw string. | if baggage is present |
1414

@@ -24,11 +24,15 @@ This issue was [fixed](https://github.com/open-telemetry/opentelemetry-go-contri
2424

2525
### Interop and trace ids
2626

27-
The OT trace propagation format expects trace ids to be 64-bits. In order to
28-
interop with OpenTelemetry, trace ids need to be truncated to 64-bits before
29-
sending them on the wire. When truncating, the least significant (right-most)
30-
bits MUST be retained. For example, a trace id of
31-
`3c3039f4d78d5c02ee8e3e41b17ce105` would be truncated to `ee8e3e41b17ce105`.
27+
OTTrace was changed to be interoperable with other format so it is supposed to 8 or 16 byte array values for the trace-id.
28+
29+
In order to do that Lightstep released a version of the OTTrace propagators in OpenTracing SDKs that left padded 64-bit headers to 128-bits using an additional 64-bit of 0s.
30+
31+
The reality of the world is not every application upgraded to support 16 byte array propagation format, but this propagator must still convert legacy 64-bit trace ids to match the W3C Trace Context Trace ID 16 byte array.
32+
33+
In addition to that it must be interoperable with legacy OTTracers, which expect 64-bit headers so this propagator truncates the value from a 128-bit to a 64-bit value before inject it into the carrier.
34+
35+
This propagator is compatible with 64-bit or 128-bit trace ids when extracting the parent context, however it truncates the trace ids down to 64-bit trace ids when injecting the context.
3236

3337
### Baggage Notes
3438

0 commit comments

Comments
 (0)