-
Notifications
You must be signed in to change notification settings - Fork 93
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(normalization): Scrub span description URLs #2095
feat(normalization): Scrub span description URLs #2095
Conversation
.and_then(|data| { | ||
data.insert( | ||
"description.scrubbed".to_owned(), | ||
Annotated::new(Value::String(new_desc.to_owned())), |
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.
I was having some issues to add the scrubbed description as the value here, and the dance around scrubbed values above is a result of this.
.unwrap(); | ||
|
||
assert_eq!($input, span.value().unwrap().description.value().unwrap()); | ||
if $output == "" { |
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.
Ideally, this is Option::None
, I'll address this in a future PR.
|
||
if let Some(is_url_like) = span.op.value().map(|op| op.starts_with("http")) { | ||
if is_url_like && scrub_identifiers(&mut scrubbed)? { | ||
let Some(new_desc) = scrubbed.value() else { |
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.
you could use .into_value()
here instead of the .value()
, since it would give the the Option<String>
and there won't be any need to to new_desc.to_owned()
where you allocate another string again on line 476
* master: (178 commits) ref(crons): Allow `_` in monitor slugs (#2100) fix(span-metrics): Scrub subdomains in metric tags (#2103) feat(normalization): Scrub span description URLs (#2095) feat(dynamic-sampling): Add possibility to run dynamic sampling from `sentry-relay` (#2091) ref(dynamic-config): Remove transaction metrics allowlist from Sentry (#2092) feat(protocol): Support old effective-directory format (#2048) ref(spans): Add more tags to span metrics (#2090) fix(server): Support HTTP half-close connections (#2089) ref(spans): Use transactions namespace with `span` prefix (#2087) ref(spans): Update span metrics feature flag name (#2086) feat(metrics): Extract more metrics from spans (#2080) build: Bump tempfile to remove flagged dependency (#2085) feat(filter): Add document_uri csp filter (#2059) build: Use jemalloc on Linux (#2084) ci(gha): add debugging for "Couldn'\''t write tracker file" issue (#2081) feat(crons): Pass-through minimal `sdk` field (#2073) fix(quota): Parse large limits (#2079) instr(server): More details on unexpected envelope drop (#2077) fix(ci): Skip flaky integration test (#2076) feat(dynamic-sampling): Add support for `trace.replay_id` in matching rules (#2070) ...
Scrub identifiers from URLs in span description. The scrubbed description is available in the span as
data['description.scrubbed']
, and in case something was scrubbed, aspan.description
tag is added to span metrics. This only happens to these projects with the feature flag enabled.