Skip to content

Commit

Permalink
Use hex encoding for trace id and span id fields in OTLP JSON encodin…
Browse files Browse the repository at this point in the history
…g (#911)

Resolves: open-telemetry/opentelemetry-specification#786

See discussion and motivation for the change in the issue linked above.

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
  • Loading branch information
2 people authored and VinozzZ committed Jun 21, 2024
1 parent 68c5856 commit 25eb61c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions specification/protocol/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,13 @@ sides.

JSON-encoded Protobuf payloads use proto3 standard defined
[JSON Mapping](https://developers.google.com/protocol-buffers/docs/proto3#json)
for mapping between Protobuf and JSON. `trace_id` and `span_id` is base64
encoded, not hex.
for mapping between Protobuf and JSON, with one deviation from that mapping: the
`trace_id` and `span_id` byte arrays are represented as
[case-insensitive hex-encoded strings](https://tools.ietf.org/html/rfc4648#section-8),
they are not base64-encoded like it is defined in the standard
[JSON Mapping](https://developers.google.com/protocol-buffers/docs/proto3#json).
The hex encoding is used for `trace_id` and `span_id` fields in all OTLP
Protobuf messages, e.g. the `Span`, `Link`, `LogRecord`, etc. messages.

#### Response

Expand Down

0 comments on commit 25eb61c

Please sign in to comment.