Commit 074466b
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#48091 parent 12cd1b1 commit 074466b
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| |||
0 commit comments