Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Attributes field type in Logs Data Model #3816

Closed

Conversation

pellared
Copy link
Member

@pellared pellared commented Jan 11, 2024

Changes

Change the type of Attributes to reference the common definition of attributes collection.

Why

None language currently supports "nested values" in log attributes. All of them represent attributes in the same way for all signals.

I feel it would be awkward if attributes in different signals would be modeled differently especially that attributes are defined in the specification separately in a "common" directory. Moreover, the common definition of attributes collection even mentions logs attributes:

[Log Records](../logs/data-model.md) may contain a collection of attributes. The

If we would like to have "nested values" in attributes then I think that it should be addressed as part of #376.

I think that the most important thing is to handle "nested values" in Body so that logs can handle structured log records (events).

EDIT: However, a lot of logging attributes allow adding nested/structured attributes to the log records.

These changes can be seen as breaking. However, there is 100% precedence of how log attributes and resource are currently handled in all languages that have logs marked as stable and experimental (except Erlang which I have not checked).

Related PRs:

@pellared pellared changed the title [WIP] Update types of Resource and Attributes fields in Logs Data Model Update types of Resource and Attributes fields in Logs Data Model Jan 11, 2024
@pellared pellared marked this pull request as ready for review January 11, 2024 16:05
@pellared pellared requested review from a team as code owners January 11, 2024 16:05
@pellared pellared changed the title Update types of Resource and Attributes fields in Logs Data Model Update Attributes field type in Logs Data Model Jan 16, 2024
@pellared
Copy link
Member Author

pellared commented Jan 16, 2024

SIG meeting notes:

  1. The languages' Bridge API can (probably) still add support for log attributes in a backwards compatible way (e.g. by making it possible to set LogAttributes (which can support nested values) and Attributes (which are the "common" attributes).
  2. Some called out that nested attributes for logs are problematic (and unwelcome) for backends as they cannot be handled as efficiently as common attributes.

@pellared
Copy link
Member Author

pellared commented Jan 17, 2024

After digesting all the information I decide to mark the PR as draft and wait until the resolution of #2888. If it is merged then this PR could be probably stay as it is. Otherwise, it would be probably good to add notices that log attributes are different from (a superset of) common attributes.

@pellared pellared marked this pull request as draft January 17, 2024 06:56
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants