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(relay): add view hierarchy scrubbing #4452

Merged
merged 27 commits into from
Jan 23, 2025

Conversation

Litarnus
Copy link
Contributor

This PR adds explicit ViewHierarchy scrubbing to the attachment scrubbing process.

Most of the logic is taken from the current recording scrubbing because both are JSON files.

@Litarnus Litarnus changed the title Martinl/viewhierarchy scrubbing feat(relay): add view hierarchy scrubbing Jan 16, 2025
# Conflicts:
#	Cargo.lock
#	relay-pii/Cargo.toml
#	relay-server/src/services/processor/attachment.rs
#	tests/integration/test_attachments.py
@Litarnus Litarnus self-assigned this Jan 16, 2025
@Litarnus Litarnus marked this pull request as ready for review January 17, 2025 10:59
@Litarnus Litarnus requested a review from a team as a code owner January 17, 2025 10:59
relay-pii/src/attachments.rs Outdated Show resolved Hide resolved
relay-pii/src/json.rs Outdated Show resolved Hide resolved
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Looks good!

relay-pii/src/attachments.rs Outdated Show resolved Hide resolved
@@ -49,6 +49,7 @@ use serde::de;
/// }
/// }
/// ```
#[allow(missing_docs)]
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 add some docs instead?

Copy link
Contributor Author

@Litarnus Litarnus Jan 20, 2025

Choose a reason for hiding this comment

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

I'm not sure how valuable they would be. Most of the functions are transform_<type> so docs would look like Transforms a bool using the given transformation. By default it will use the identity function which is sort of what is already mentioned in the doc block for the Trait.

relay-server/src/services/processor/attachment.rs Outdated Show resolved Hide resolved
@@ -90,14 +91,12 @@ pub trait Transform<'de> {
v
}

serde::serde_if_integer128! {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

relay-server/src/services/processor/attachment.rs Outdated Show resolved Hide resolved
match processor.scrub_json(&payload) {
Ok(output) => {
metric!(
timer(RelayTimers::ViewHierarchyScrubbing) = start.elapsed(),
Copy link
Member

Choose a reason for hiding this comment

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

Probably the wrong PR for this, but we could just have a generic 'attachment scrubbing' metric and tag it with what is being scrubbed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do have a generic AttachmentScrubbing metric with the attachment_type as a tag but it seems to pertain to the generic scrub_attachment function while the specific one is emitted if a specific scrub function fails and it falls back to the generic scrub function, see scrub_minidump.

@Litarnus Litarnus linked an issue Jan 23, 2025 that may be closed by this pull request
@Litarnus Litarnus merged commit ea156e9 into master Jan 23, 2025
25 checks passed
@Litarnus Litarnus deleted the martinl/viewhierarchy-scrubbing branch January 23, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support data scrubbing for ViewHierarchy attachments
4 participants