Repository navigation
fix(browser): Apply urlQueryParams to event URLs, static span names and LCP URLs - #25262
Conversation
… and LCP URLs `dataCollection.urlQueryParams` only filtered `url.full` and `url.query`. The page URL in `event.request.url`, the static `browser.*` and `resource.*` span names, and the LCP URL attributes still sent sensitive values such as `?jwt=...` to Sentry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 68306da. Configure here.
|
|
||
| startAndEndSpan(span, responseStartTimestamp, responseEndTimestamp, { | ||
| name: spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES[BROWSER_RESPONSE] : entry.name, | ||
| name: spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES[BROWSER_RESPONSE] : url, |
There was a problem hiding this comment.
Query filter ignores owning client
Low Severity
This is a check on whether getClient() is necessary, not a hard rule break. filterCollectedUrl runs for navigation and resource span URLs and for static lcp.url without the tracing client. It then reads urlQueryParams from getClient(), which can be missing or a different client, so that client's dataCollection.urlQueryParams policy is not applied.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 68306da. Configure here.
There was a problem hiding this comment.
technically yes if the client changes between span start and completion i guess. but pre-existing (here and elsewhere), so not a blocker imo
size-limit report 📦
|
…n names and LCP URLs
| return; | ||
| } | ||
| const op = NAVIGATION_TIMING_SPAN_OPS[event]; | ||
| const url = filterCollectedUrl(entry.name); |
There was a problem hiding this comment.
nit: can we rename this to filteredUrl?
There was a problem hiding this comment.
yup good idea. I changed it
…n names and LCP URLs
… URLs (#25289) follow up to #25262 This applies `dataCollection.urlQueryParams` to the URLs in the fetch, XHR and navigation breadcrumbs and to the `ui.element.url` attribute of `elementTimingIntegration`. These still sent sensitive query values such as `?jwt=...` to Sentry. ## Sentry events Before (11.6.0), `jwt=sensitive-jwt-value` in the breadcrumbs: https://sentry-sdks.sentry.io/issues/7787761489/events/2bfc6630501c4314bf84b884a4afb1e9/ After (this PR), `jwt=[Filtered]`: https://sentry-sdks.sentry.io/issues/7787761463/events/6ae067a147b84e6eb33553ae7ce217c7/ Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>


closes #25247
closes JS-3907
Description
This applies
dataCollection.urlQueryParamsto the URLs that the browser SDK still sent unfiltered: the page URL inevent.request.url, thebrowser.*andresource.*span names in the static trace lifecycle, and the LCP URL attributes (lcp.url,browser.web_vital.lcp.url).event.request.urlleaked on error events with every trace lifecycle, the span names only withtraceLifecycle: 'static'(the v10 default).Most of the added lines are tests.
Sentry traces
Before (11.6.0),
jwt=sensitive-jwt-valueinrequest.urland span names: https://sentry-sdks.sentry.io/explore/traces/trace/056ddfee720849c78e4e0b68f9da8c5b/?project=4510555608449024×tamp=1791796663After (this PR),
jwt=[Filtered]: https://sentry-sdks.sentry.io/explore/traces/trace/ea9fd2cc90de4343bf5bfb6eb0d923ad/?project=4510555608449024×tamp=1791796677