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

feat(spans): Retain empty attributes #4174

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion relay-event-schema/src/protocol/contexts/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub struct TraceContext {
pub sampled: Annotated<bool>,

/// Data of the trace's root span.
#[metastructure(pii = "maybe", skip_serialization = "empty")]
#[metastructure(pii = "maybe", skip_serialization = "null")]
Copy link
Member

Choose a reason for hiding this comment

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

Should we ever skip here? I assume the Python SDK setting data to None would be serialized as null which we then skip incorrectly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Skipping null would be correct IMO, but a side effect of this change is that data: {} is not be skipped anymore. I will add some more tests.

pub data: Annotated<SpanData>,

/// Additional arbitrary fields for forwards compatibility.
Expand Down
2 changes: 1 addition & 1 deletion relay-event-schema/src/protocol/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ pub struct SpanData {
additional_properties,
pii = "true",
retain = "true",
skip_serialization = "empty"
skip_serialization = "null"
)]
pub other: Object<Value>,
}
Expand Down
Loading