Skip to content

fix(tracemetrics): Update pii scrubbing#5815

Merged
jjbayer merged 4 commits intomasterfrom
fix/tracemetrics/update-pii-scrubbing
Apr 15, 2026
Merged

fix(tracemetrics): Update pii scrubbing#5815
jjbayer merged 4 commits intomasterfrom
fix/tracemetrics/update-pii-scrubbing

Conversation

@k-fish
Copy link
Copy Markdown
Member

@k-fish k-fish commented Apr 10, 2026

This updates pii scrubbing to use the eap pii scrub package just like scrub_log does now, and adds some more tests to ensure pii scrubbing is happening properly before we add UI.

This updates pii scrubbing to use the eap pii scrub package just like scrub_log does now, and adds some more tests to ensure pii scrubbing is happening properly before we add UI.
@k-fish k-fish requested a review from a team as a code owner April 10, 2026 18:37
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde left a comment

Choose a reason for hiding this comment

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

For assertion we started more and more to go towards asserting the entire items, or bigger keys of an item, for example in this ourlogs test:

assert item == {
"trace_id": "5b8efff798038103d269b633813fc60c",
"span_id": "eee19b7ec3c1b174",
"attributes": {
"test_pii": {"type": "string", "value": expected_scrubbed},
"sentry.browser.name": {"type": "string", "value": "Python Requests"},
"sentry.browser.version": {"type": "string", "value": "2.32"},
"sentry.observed_timestamp_nanos": {
"type": "string",
"value": time_within(ts, expect_resolution="ns"),
},
},
"__header": {"byte_size": mock.ANY},
"_meta": {
"attributes": {
"test_pii": {
"value": {
"": {
"len": mock.ANY,
"rem": [[rule_type, mock.ANY, mock.ANY, mock.ANY]],
}
}
}
},
},
"body": "Test log",
"level": "info",
"timestamp": time_within(ts),
}

This often is barely more lines of code, but it is also less error prone (e.g. no need to check the length/size to check for additional keys) and it covers more regression cases.

Comment thread tests/integration/test_trace_metrics.py Outdated
@k-fish k-fish force-pushed the fix/tracemetrics/update-pii-scrubbing branch from 48d014d to b0ec7b9 Compare April 13, 2026 16:55
@k-fish k-fish force-pushed the fix/tracemetrics/update-pii-scrubbing branch from cae0ace to e989af9 Compare April 14, 2026 17:47
@k-fish k-fish added this pull request to the merge queue Apr 14, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 14, 2026
@jjbayer jjbayer added this pull request to the merge queue Apr 15, 2026
Merged via the queue into master with commit 835c3f4 Apr 15, 2026
30 checks passed
@jjbayer jjbayer deleted the fix/tracemetrics/update-pii-scrubbing branch April 15, 2026 12:29
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.

3 participants