Skip to content

Commit

Permalink
Clarify that lowerCamelCase field names MUST be used for OTLP/JSON
Browse files Browse the repository at this point in the history
Resolves #2795

This is a breaking change for OTLP/JSON and is allowed because OTLP/JSON is not yet Stable.
  • Loading branch information
tigrannajaryan committed Oct 5, 2022
1 parent 3abfa25 commit 2218e6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ release.

### OpenTelemetry Protocol

- Clarify that lowerCamelCase field names MUST be used for OTLP/JSON
([#2829](https:/open-telemetry/opentelemetry-specification/pull/2829))
- Add user agent to OTLP exporter specification
([#2684](https:/open-telemetry/opentelemetry-specification/pull/2684))
- Prohibit usage of enum value name strings in OTLP/JSON
Expand Down
7 changes: 7 additions & 0 deletions specification/protocol/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ for mapping between Protobuf and JSON, with the following deviations from that m
This aligns with the behavior of the Binary Protobuf unmarshaler and ensures that adding
new fields to OTLP messages does not break existing receivers.

- The keys of JSON objects are field names converted to lowerCamelCase. Original
field names are not valid to use a keys of JSON objects.
For example this is a valid JSON representation of a Resource:
`{ "attributes": {...}, droppedAttributesCount: 123 }`, and this is NOT a valid
representation:
`{ "attributes": {...}, dropped_attributes_count: 123 }`.

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 2218e6e

Please sign in to comment.