Skip to content

Commit

Permalink
Clarify that unknown fields must be ignored when receiving OTLP/JSON …
Browse files Browse the repository at this point in the history
…(#2816)

* Clarify that unknown fields must be ignored when receiving OTLP/JSON

Resolves open-telemetry#425

The proposed behavior is necessary for interoperability of senders and receivers
when OTLP protocol evolves in an allowed way: by adding new fields to existing
messages.

* Remove unnecessary sentence

* Fix typo

Co-authored-by: Yuri Shkuro <[email protected]>
  • Loading branch information
tigrannajaryan and yurishkuro committed Sep 27, 2022
1 parent f2fb104 commit 9db4949
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions specification/protocol/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ for mapping between Protobuf and JSON, with the following deviations from that m
represented like this:
{ "kind": 2, ... }

- OTLP/JSON receivers MUST ignore message fields with unknown names and MUST unmarshal the
message as if the unknown field was not present in the payload.
This aligns with the behavior of the Binary Protobuf unmarshaler and ensures that adding
new fields to OTLP messages does not break existing receivers.

Note that according to [Protobuf specs](
https://developers.google.com/protocol-buffers/docs/proto3#json) 64-bit integer
numbers in JSON-encoded payloads are encoded as decimal strings, and either
Expand Down

0 comments on commit 9db4949

Please sign in to comment.