-
Notifications
You must be signed in to change notification settings - Fork 117
feat(pii): Base SpanData PII on relay-conventions #5997
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
Changes from all commits
eea1bbf
0e8be5e
55ab550
0bbd1e3
e48ff37
677e075
1b71ccb
7fa8c6d
d8d48b6
f0ef69f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -594,10 +594,11 @@ impl<'a> ProcessingState<'a> { | |
|
|
||
| /// Derives the attrs for recursion. | ||
| pub fn inner_attrs(&self) -> Option<Cow<'_, FieldAttrs>> { | ||
| match self.pii() { | ||
| Pii::True => Some(Cow::Borrowed(&PII_TRUE_FIELD_ATTRS)), | ||
| Pii::False => None, | ||
| Pii::Maybe => Some(Cow::Borrowed(&PII_MAYBE_FIELD_ATTRS)), | ||
| match self.attrs().pii { | ||
| PiiMode::Static(Pii::True) => Some(Cow::Borrowed(&PII_TRUE_FIELD_ATTRS)), | ||
| PiiMode::Static(Pii::False) => None, | ||
| PiiMode::Static(Pii::Maybe) => Some(Cow::Borrowed(&PII_MAYBE_FIELD_ATTRS)), | ||
| PiiMode::Dynamic(f) => Some(Cow::Owned(DEFAULT_FIELD_ATTRS.pii_dynamic(f))), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dynamic PII in
|
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,7 +291,7 @@ regex!( | |
| ) | ||
| ) | ||
| ( | ||
| [^/\\\r\n]+ | ||
| [^/\\\r\n\x00]+ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this regex can match a null byte it causes problems with redactions. |
||
| ) | ||
| " | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1481,12 +1481,19 @@ def test_spansv2_attribute_normalization( | |
| http_result = spans_by_id[http_span_id] | ||
| assert http_result == { | ||
| **common, | ||
| "_meta": { | ||
| "attributes": { | ||
| "url.full": { | ||
| "value": {"": {"len": 63, "rem": [["@userpath", "s", 29, 35]]}} | ||
| } | ||
| } | ||
| }, | ||
|
Dav1dde marked this conversation as resolved.
|
||
| "span_id": http_span_id, | ||
| "attributes": { | ||
| "sentry.category": {"type": "string", "value": "http"}, | ||
| "sentry.description": { | ||
| "type": "string", | ||
| "value": "GET https://www.service.io/users/01234-qwerty/settings/98765-adfghj", | ||
| "value": "GET https://www.service.io/users/[user]/settings/98765-adfghj", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This attribute is filled from |
||
| }, | ||
| "sentry.op": {"type": "string", "value": "http.client"}, | ||
| "sentry.observed_timestamp_nanos": { | ||
|
|
@@ -1504,7 +1511,7 @@ def test_spansv2_attribute_normalization( | |
| "sentry.dsc.transaction": {"type": "string", "value": "/my/fancy/endpoint"}, | ||
| "url.full": { | ||
| "type": "string", | ||
| "value": "https://www.service.io/users/01234-qwerty/settings/98765-adfghj", | ||
| "value": "https://www.service.io/users/[user]/settings/98765-adfghj", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This attribute has become |
||
| }, | ||
| }, | ||
| } | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, when deriving the attributes for recursion, we would eagerly resolve a dynamic PII value function into a static value. Now we instead pass the dynamic function through.