Skip to content

Commit 72df625

Browse files
Clarify that lowerCamelCase field names MUST be used for OTLP/JSON
Resolves #2795 This is a breaking change for OTLP/JSON and is allowed because OTLP/JSON is not yet Stable.
1 parent 0ff1c36 commit 72df625

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ release.
3434

3535
### OpenTelemetry Protocol
3636

37+
- Clarify that lowerCamelCase field names MUST be used for OTLP/JSON
38+
([#2829](https://github.com/open-telemetry/opentelemetry-specification/pull/2829))
3739
- Add user agent to OTLP exporter specification
3840
([#2684](https://github.com/open-telemetry/opentelemetry-specification/pull/2684))
3941

specification/protocol/otlp.md

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

422+
- The keys of JSON objects are field names converted to lowerCamelCase. Original
423+
field names are not valid to use a keys of JSON objects.
424+
For example this is a valid JSON representation of a Resource:
425+
`{ "attributes": {...}, droppedAttributesCount: 123 }`, and this is NOT a valid
426+
representation:
427+
`{ "attributes": {...}, dropped_attributes_count: 123 }`.
428+
422429
Note that according to [Protobuf specs](
423-
https://developers.google.com/protocol-buffers/docs/proto3#json) 64-bit integer
424-
numbers in JSON-encoded payloads are encoded as decimal strings, and either
425-
numbers or strings are accepted when decoding.
430+
https://developers.google.com/protocol-buffers/docs/proto3#json):
431+
432+
- 64-bit integer numbers in JSON-encoded payloads are encoded as decimal strings, and
433+
either numbers or strings are accepted when decoding.
426434

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

0 commit comments

Comments
 (0)