Skip to content

Commit

Permalink
Add support for empty values in Logs Data Model (open-telemetry#3853)
Browse files Browse the repository at this point in the history
Fixes
open-telemetry#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-
  • Loading branch information
pellared authored Mar 8, 2024
1 parent 0435a86 commit 559ddb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion specification/logs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ Value of type `any` can be one of the following:

- An array (a list) of `any` values,

- A `map<string, any>`.
- A `map<string, any>`,

- [since 1.31.0] An empty value (e.g. `null`).

#### Type `map<string, any>`

Expand Down

0 comments on commit 559ddb4

Please sign in to comment.