diff --git a/CHANGELOG.md b/CHANGELOG.md index 0871d1608a3..9218fe4caf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ release. ### Logs +- Allow implementations to export duplicate keys in a map as an opt-in option. + ([#3938](https://github.com/open-telemetry/opentelemetry-specification/pull/3938)) + ### Events ### Resource diff --git a/specification/logs/data-model.md b/specification/logs/data-model.md index cde901399f6..d0281c70533 100644 --- a/specification/logs/data-model.md +++ b/specification/logs/data-model.md @@ -119,12 +119,21 @@ Value of type `any` can be one of the following: #### Type `map` Value of type `map` is a map of string keys to `any` values. The -keys in the map are unique (duplicate keys are not allowed). The representation -of the map is language-dependent. +keys in the map are unique (duplicate keys are not allowed). Arbitrary deep nesting of values for arrays and maps is allowed (essentially allows to represent an equivalent of a JSON object). +The representation of the map is language-dependent. + +The implementation MUST by default ensure that the exported maps contain only unique keys. + +The implementation MAY have an option to allow exporting maps with duplicate keys +(e.g. for better performance). +If such option is provided, it MUST be documented that for many receivers, +handling of maps with duplicate keys is unpredictable and it is the users' +responsibility to ensure keys are not duplicate. + ### Field Kinds This Data Model defines a logical model for a log record (irrespective of the