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

logs: introduce LogAttributes type #4342

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

xrmx
Copy link
Contributor

@xrmx xrmx commented Dec 9, 2024

Description

Logs attribute accepts AnyValue as AttributeValue add a type to describe that and start using it.

Fixes #4315

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Logs attribute accepts AnyValue as AttributeValue add a type to describe
that and start using it.
@xrmx xrmx requested a review from a team as a code owner December 9, 2024 11:45
@xrmx xrmx marked this pull request as draft December 9, 2024 11:46
@xrmx xrmx added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Dec 9, 2024
@xrmx xrmx marked this pull request as ready for review December 12, 2024 21:28
@@ -273,7 +273,7 @@ def get_logger(
instrumenting_library_version: str = "",
logger_provider: Optional[LoggerProvider] = None,
schema_url: Optional[str] = None,
attributes: Optional[Attributes] = None,
attributes: LogAttributes = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not to have them as Optional like other params?

Copy link
Contributor Author

@xrmx xrmx Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, it's just that it's not repeated :)

LogAttributes = Optional[Mapping[str, "AnyValue"]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Logs API and SDK: logs attributes are allowed to have AnyValue values
3 participants