Skip to content

feat(data-collection)!: Filter URL query params#8414

Open
philprime wants to merge 9 commits into
mainfrom
feat/query-parameter-filtering
Open

feat(data-collection)!: Filter URL query params#8414
philprime wants to merge 9 commits into
mainfrom
feat/query-parameter-filtering

Conversation

@philprime

@philprime philprime commented Jul 15, 2026

Copy link
Copy Markdown
Member

📜 Description

Rename the V10 data-collection options to distinguish URL and database query
parameters, then apply urlQueryParams filtering to automatic network spans,
breadcrumbs, Session Replay breadcrumb payloads, and failed-request events.

V10 URL fields retain a filtered query string while span descriptions use the
query-free base URL. The legacy SDK retains its existing query-free URL
behavior.

💡 Motivation and Context

The data-collection specification requires URL query filtering wherever an
automatically collected query string is emitted. This makes the V10 network
telemetry consistent with its key-value deny-list, allow-list, and off modes.

This is a V10-breaking option rename:

  • dataCollection.queryParamsdataCollection.urlQueryParams
  • dataCollection.database.queryParams
    dataCollection.database.urlQueryParams

Fixes #8249

💚 How did you test it?

  • make format
  • make analyze
  • make build-ios
  • make build-ios-v10
  • make test-ios ONLY_TESTING=SentryTests/UrlSanitizedTests,SentryTests/SentryNetworkTrackerTests,SentryTests/SentryDataCollectionOptionsTests,SentryTests/SentryDatabaseCollectionOptionsTests
  • make test-ios-v10 ONLY_TESTING=SentryTests/UrlSanitizedTests,SentryTests/SentryNetworkTrackerTests,SentryTests/SentryDataCollectionOptionsTests,SentryTests/SentryDatabaseCollectionOptionsTests
  • make generate-public-api

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

#skip-changelog

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 2602570

@philprime philprime changed the title feat: Filter network query parameters feat(data-collection): Filter network query parameters Jul 15, 2026
@philprime philprime self-assigned this Jul 15, 2026
@philprime
philprime force-pushed the feat/query-parameter-filtering branch from 0ec4307 to fae6e30 Compare July 15, 2026 06:14
Comment thread Sources/Sentry/SentryNetworkTracker.m Outdated
Comment thread Sources/Sentry/SentryNetworkTracker.m Outdated
Comment thread CHANGELOG.md Outdated
Comment thread Sources/Sentry/SentryNetworkTracker.m Outdated
@philprime
philprime force-pushed the feat/query-parameter-filtering branch from fae6e30 to 8a1fb04 Compare July 16, 2026 11:26
@philprime philprime changed the title feat(data-collection): Filter network query parameters feat(data-collection)!: Filter URL query params Jul 16, 2026
@philprime philprime added the ready-to-merge Use this label to trigger all PR workflows label Jul 16, 2026
@philprime
philprime changed the base branch from main to philprime/data-collection/top-level-option July 16, 2026 11:30
@sentry

sentry Bot commented Jul 16, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.22.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1220.23 ms 1258.39 ms 38.16 ms
Size 24.14 KiB 1.23 MiB 1.21 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ddbec00 1229.12 ms 1261.33 ms 32.20 ms
c1c9578 1219.32 ms 1261.74 ms 42.43 ms
f213b0b 1220.62 ms 1251.59 ms 30.97 ms
d98d6a8 1219.69 ms 1255.85 ms 36.16 ms
71859d3 1209.83 ms 1241.65 ms 31.83 ms
5e4d0a6 1230.40 ms 1255.44 ms 25.04 ms
44b7b59 1211.91 ms 1248.90 ms 36.99 ms
151b3ee 1238.69 ms 1270.73 ms 32.05 ms
4014441 1232.16 ms 1266.41 ms 34.25 ms
b95fd1b 1226.73 ms 1260.77 ms 34.03 ms

App size

Revision Plain With Sentry Diff
ddbec00 24.14 KiB 1.17 MiB 1.15 MiB
c1c9578 24.14 KiB 1.20 MiB 1.18 MiB
f213b0b 24.14 KiB 1.17 MiB 1.14 MiB
d98d6a8 24.14 KiB 1.23 MiB 1.20 MiB
71859d3 24.14 KiB 1.17 MiB 1.15 MiB
5e4d0a6 24.14 KiB 1.17 MiB 1.15 MiB
44b7b59 24.14 KiB 1.15 MiB 1.13 MiB
151b3ee 24.14 KiB 1.15 MiB 1.13 MiB
4014441 24.14 KiB 1.16 MiB 1.14 MiB
b95fd1b 24.14 KiB 1.17 MiB 1.15 MiB

Previous results on branch: feat/query-parameter-filtering

Startup times

Revision Plain With Sentry Diff
89136d8 1234.49 ms 1263.34 ms 28.85 ms
05ec8aa 1224.61 ms 1255.90 ms 31.29 ms
44e68c7 1220.22 ms 1260.73 ms 40.52 ms

App size

Revision Plain With Sentry Diff
89136d8 24.14 KiB 1.24 MiB 1.21 MiB
05ec8aa 24.14 KiB 1.24 MiB 1.21 MiB
44e68c7 24.14 KiB 1.23 MiB 1.21 MiB

@philprime
philprime force-pushed the philprime/data-collection/top-level-option branch from 94f5ff5 to 313e8d8 Compare July 16, 2026 12:18
@philprime
philprime force-pushed the feat/query-parameter-filtering branch from 8a1fb04 to dba1b18 Compare July 16, 2026 12:21
@philprime
philprime marked this pull request as ready for review July 16, 2026 12:21
Comment thread Sources/Swift/DataCollection/SentryDataCollection+DatabaseOptions.swift Outdated
Comment thread Sources/Swift/Core/Tools/UrlSanitized.swift
Comment thread Sources/Swift/DataCollection/SentryDataCollectionObjCOptions.swift Outdated
Base automatically changed from philprime/data-collection/top-level-option to main July 16, 2026 12:56
Filter automatic network query parameters in V10 spans, breadcrumbs, and failed-request events. Preserve legacy URL behavior outside V10 while exposing the renamed data collection options.

Fixes #8249
@philprime
philprime force-pushed the feat/query-parameter-filtering branch from 64f0326 to 14a8ae4 Compare July 16, 2026 13:01
Always apply the configured URL query parameter behavior when bridging options to Objective-C.

Fixes #8249
Comment thread Sources/Swift/Core/Tools/UrlSanitized.swift
Comment thread Sources/Sentry/SentryNetworkTracker.m
@philprime
philprime enabled auto-merge (squash) July 16, 2026 13:11
The V10 docs-sync test treats the private Objective-C bridge as a public option. Exempt it from user-facing documentation checks.
Comment thread Sources/Swift/DataCollection/SentryDataCollectionObjCOptions.swift
Comment thread Sources/Swift/DataCollection/SentryDataCollectionObjCOptions.swift Outdated
Comment thread Sources/Swift/DataCollection/SentryDataCollectionObjCOptions.swift
Comment thread Sources/Swift/Core/Tools/UrlSanitized.swift
Comment thread Sources/Swift/Core/Tools/UrlSanitized.swift Outdated
Comment thread Sources/Swift/Core/Tools/UrlSanitized.swift Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7892013. Configure here.

Comment thread Sources/Swift/Core/Tools/UrlSanitized.swift Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryNetworkTracker.m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ready-to-merge Use this label to trigger all PR workflows skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add query parameter filtering via dataCollection.queryParams

2 participants