Skip to content

Commit 62f2367

Browse files
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.
1 parent c7ce609 commit 62f2367

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ release.
2828

2929
- Add user agent to OTLP exporter specification
3030
([#2684](https://github.com/open-telemetry/opentelemetry-specification/pull/2684))
31+
- Clarify that unknown fields must be ignored when receiving OTLP/JSON
32+
([#2816](https://github.com/open-telemetry/opentelemetry-specification/pull/2816))
3133

3234
### SDK Configuration
3335

specification/protocol/otlp.md

+7
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ 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 resent 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+
Protobuf unmarshalling implementations often support this via an option called
427+
"Ignore unknown fields".
428+
422429
Note that according to [Protobuf specs](
423430
https://developers.google.com/protocol-buffers/docs/proto3#json) 64-bit integer
424431
numbers in JSON-encoded payloads are encoded as decimal strings, and either

0 commit comments

Comments
 (0)