Skip to content

Fix Resource field type in Logs Data Model#3826

Merged
tigrannajaryan merged 2 commits intoopen-telemetry:mainfrom
pellared:log-brdige-fix-resource-type
Jan 18, 2024
Merged

Fix Resource field type in Logs Data Model#3826
tigrannajaryan merged 2 commits intoopen-telemetry:mainfrom
pellared:log-brdige-fix-resource-type

Conversation

@pellared
Copy link
Copy Markdown
Member

@pellared pellared commented Jan 16, 2024

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.

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:

@pellared pellared marked this pull request as ready for review January 16, 2024 11:24
@pellared pellared requested review from a team January 16, 2024 11:24
@tigrannajaryan
Copy link
Copy Markdown
Member

This has been open for 2 days, has enough approvals, merging.

@tigrannajaryan tigrannajaryan merged commit 074466b into open-telemetry:main Jan 18, 2024
@pellared pellared deleted the log-brdige-fix-resource-type branch January 22, 2024 13:24
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
## 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:
-
open-telemetry#2888
- open-telemetry/opentelemetry-go#4809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants