Skip to content

Commit 074466b

Browse files
authored
Fix Resource field type in Logs Data Model (#3826)
## Changes Change the type of `Resource` to reference the definition in the SDK so that the resource's scheme URL is included in logs data model. ## Why The Logs Data Model misses scheme URL of resource. All of the languages reuse a common type representing resource. - Java (stable logs): [reuses a common resource type](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/data/LogRecordData.java) - .NET (stable logs): [reuses a common resource type](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs) - C++ (stable logs): [reuses a common resource type](https://github.com/open-telemetry/opentelemetry-cpp/blob/main/sdk/src/logs/read_write_log_record.cc) - Python (experimental logs): [reuses a common resource type](https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py) These changes can be seen as breaking. However, there is 100% precedence of how log attributes and resource are currently handled in all languages. I see the current description as a bug because we would miss scheme URL of the resource. AFAIK the intention of the OTel Logs Specification authors was to have only nested values for Body and Attributes. Related PRs: - #2888 - open-telemetry/opentelemetry-go#4809
1 parent 12cd1b1 commit 074466b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ release.
1515

1616
### Logs
1717

18+
- Fix `Resource` field type in Logs Data Model.
19+
([#3826](https://github.com/open-telemetry/opentelemetry-specification/pull/3826))
20+
1821
### Resource
1922

2023
### OpenTelemetry Protocol

specification/logs/data-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ source. This field is optional.
415415

416416
### Field: `Resource`
417417

418-
Type: `map<string, any>`.
418+
Type: [Resource](../resource/sdk.md).
419419

420420
Description: Describes the source of the log, aka
421421
[resource](../overview.md#resources). Multiple occurrences of events coming from

0 commit comments

Comments
 (0)