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
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.
  • Loading branch information
tigrannajaryan committed Sep 20, 2022
1 parent c7ce609 commit 8a84938
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ release.

- Add user agent to OTLP exporter specification
([#2684](https:/open-telemetry/opentelemetry-specification/pull/2684))
- Clarify that unknown fields must be ignored when receiving OTLP/JSON
([#](https:/open-telemetry/opentelemetry-specification/pull/))

### SDK Configuration

Expand Down
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 resent 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 8a84938

Please sign in to comment.