From 6669a78fd40b30863f92cafe2254ab3aada58d58 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Tue, 27 Sep 2022 13:14:10 -0400 Subject: [PATCH] Clarify that unknown fields must be ignored when receiving OTLP/JSON (#2816) * Clarify that unknown fields must be ignored when receiving OTLP/JSON Resolves https://github.com/open-telemetry/opentelemetry-proto/issues/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 --- specification/protocol/otlp.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/specification/protocol/otlp.md b/specification/protocol/otlp.md index 824aadc55..75f6fd6f7 100644 --- a/specification/protocol/otlp.md +++ b/specification/protocol/otlp.md @@ -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