Skip to content

BoundedAttributes validation is too strict for logs #4515

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

Open
xrmx opened this issue Mar 28, 2025 · 0 comments · May be fixed by #4342
Open

BoundedAttributes validation is too strict for logs #4515

xrmx opened this issue Mar 28, 2025 · 0 comments · May be fixed by #4342
Assignees
Labels
bug Something isn't working

Comments

@xrmx
Copy link
Contributor

xrmx commented Mar 28, 2025

Describe your environment

OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.8.10)
SDK version: (e.g., 1.25.0) 1.31.1
API version: (e.g., 1.25.0) 1.31.1

What happened?

When we create LogRecord instances we convert the attributes to instances of BoundedAttributes.
BoundedAttributes validates values to be one of bool, str, bytes, int, float when in log we should support AnyValue as stated by the spec https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-attributes

Steps to Reproduce

Send a dict as attribute value

Expected Result

Dict attribute is serialized

Actual Result

Warning is raised instead Invalid type dict for attribute 'request_header' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types

Additional context

No response

Would you like to implement a fix?

None

@xrmx xrmx added the bug Something isn't working label Mar 28, 2025
@xrmx xrmx self-assigned this Mar 31, 2025
@xrmx xrmx linked a pull request Apr 2, 2025 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant