Skip to content

Commit

Permalink
Clarify that original and lowerCamelCase field names are allowed for …
Browse files Browse the repository at this point in the history
…OTLP/JSON

Resolves #2795

This is already the current understanding. This is just a clarification and
describes the behavior explicitly.
  • Loading branch information
tigrannajaryan committed Sep 23, 2022
1 parent 0ff1c36 commit f5a713c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ release.

### OpenTelemetry Protocol

- Clarify that original and lowerCamelCase field names are allowed for OTLP/JSON
([#2829](https://github.com/open-telemetry/opentelemetry-specification/pull/2829))
- Add user agent to OTLP exporter specification
([#2684](https://github.com/open-telemetry/opentelemetry-specification/pull/2684))

Expand Down
11 changes: 8 additions & 3 deletions specification/protocol/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,14 @@ for mapping between Protobuf and JSON, with the following deviations from that m
{ "kind": 2, ... }

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
numbers or strings are accepted when decoding.
https://developers.google.com/protocol-buffers/docs/proto3#json):

- 64-bit integer numbers in JSON-encoded payloads are encoded as decimal strings, and
either numbers or strings are accepted when decoding.

- Encoders are allowed to produce field names either equal to the original field names
declared in the proto files or converted to equivalent lowerCamelCase. Decoders
MUST accept both original field names and lowerCamelCase versions.

The client and the server MUST set "Content-Type: application/json" request and
response headers when sending JSON Protobuf encoded payload.
Expand Down

0 comments on commit f5a713c

Please sign in to comment.