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

_encode_events assumes that event.attributes.dropped exists #3761

Closed
alexmojaki opened this issue Mar 7, 2024 · 2 comments · Fixed by #3965
Closed

_encode_events assumes that event.attributes.dropped exists #3761

alexmojaki opened this issue Mar 7, 2024 · 2 comments · Fixed by #3965
Assignees
Labels
bug Something isn't working help wanted

Comments

@alexmojaki
Copy link

This line:

is essentially assuming that event.attributes is a BoundedAttributes, but its type is declared as types.Attributes, i.e. Optional[Mapping[str, AttributeValue]]. This means that event.attributes could easily be another mapping such as dict or even None in which case trying to access .dropped raises AttributeError.

Just above in the same file is an example of one good way to solve this:

i.e. a property Event.dropped_attributes identical to ReadableSpan.dropped_attributes could be created.

For context, I encountered this problem while creating modified copies of Event objects in which sensitive data is removed in a custom SpanProcessor.

@alexmojaki alexmojaki added the bug Something isn't working label Mar 7, 2024
@soumyadeepm04
Copy link
Contributor

Hello, if no one is working on this, could I have a go at it?

@pmcollins
Copy link
Member

Please feel free @soumyadeepm04 if you are still interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants