From a0aee78e704d30e3cb2ce34823c347e521741e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 8 Mar 2024 16:49:47 +0100 Subject: [PATCH] Add support for empty values in Logs Data Model (#3853) Fixes https://github.com/open-telemetry/opentelemetry-specification/issues/3835 ## Changes - Define empty value as an acceptable type for `any` I think that adding support for additional type is not a breaking change. I also think that users may also want to preserve the empty values that are in structured data (e.g. record body and attributes) that they emit in their applications. E.g. `slog` a structured logging package which is part of Go standard library accepts `nil` (null, empty value) as a valid attribute value. The Bridge API should do its best to carry over as much logging data as possible until it is can be passed via OTLP . See: https://go.dev/play/p/KN5Wea6h_f- --- CHANGELOG.md | 2 ++ specification/logs/data-model.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4003818053..2bfb0713f4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ release. ([#3884](https://github.com/open-telemetry/opentelemetry-specification/pull/3884)) - Clarify that logs attributes are a superset of standard attributes. ([#3852](https://github.com/open-telemetry/opentelemetry-specification/pull/3852)) +- Add support for empty values. + ([#3853](https://github.com/open-telemetry/opentelemetry-specification/pull/3853)) ### Resource diff --git a/specification/logs/data-model.md b/specification/logs/data-model.md index 8bace296920..b03459e4cc7 100644 --- a/specification/logs/data-model.md +++ b/specification/logs/data-model.md @@ -112,7 +112,9 @@ Value of type `any` can be one of the following: - An array (a list) of `any` values, -- A `map`. +- A `map`, + +- [since 1.31.0] An empty value (e.g. `null`). #### Type `map`