Skip to content

Commit 475b3dd

Browse files
Clarify that unknown fields must be ignored when receiving OTLP/JSON (open-telemetry#2816)
* Clarify that unknown fields must be ignored when receiving OTLP/JSON Resolves open-telemetry/opentelemetry-proto#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]>
1 parent 789fb91 commit 475b3dd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ release.
3939

4040
- Add user agent to OTLP exporter specification
4141
([#2684](https://github.com/open-telemetry/opentelemetry-specification/pull/2684))
42+
- Clarify that unknown fields must be ignored when receiving OTLP/JSON
43+
([#2816](https://github.com/open-telemetry/opentelemetry-specification/pull/2816))
4244

4345
### SDK Configuration
4446

specification/protocol/otlp.md

+5
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ for mapping between Protobuf and JSON, with the following deviations from that m
419419
represented like this:
420420
{ "kind": 2, ... }
421421

422+
- OTLP/JSON receivers MUST ignore message fields with unknown names and MUST unmarshal the
423+
message as if the unknown field was not present in the payload.
424+
This aligns with the behavior of the Binary Protobuf unmarshaler and ensures that adding
425+
new fields to OTLP messages does not break existing receivers.
426+
422427
Note that according to [Protobuf specs](
423428
https://developers.google.com/protocol-buffers/docs/proto3#json) 64-bit integer
424429
numbers in JSON-encoded payloads are encoded as decimal strings, and either

0 commit comments

Comments
 (0)