diff --git a/CHANGELOG.md b/CHANGELOG.md index 88aefdf418a..f842d326bed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ release. - Add user agent to OTLP exporter specification ([#2684](https://github.com/open-telemetry/opentelemetry-specification/pull/2684)) +- Clarify that unknown fields must be ignored when receiving OTLP/JSON + ([#2816](https://github.com/open-telemetry/opentelemetry-specification/pull/2816)) ### SDK Configuration diff --git a/specification/protocol/otlp.md b/specification/protocol/otlp.md index 824aadc5582..75f6fd6f754 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