Skip to content

fix(ktor): [Data Collection 20] Exclude query parameters from span descriptions - #5983

Draft
adinauer wants to merge 2 commits into
fix/data-collection-preserve-installation-idfrom
fix/data-collection-ktor-span-description
Draft

fix(ktor): [Data Collection 20] Exclude query parameters from span descriptions#5983
adinauer wants to merge 2 commits into
fix/data-collection-preserve-installation-idfrom
fix/data-collection-ktor-span-description

Conversation

@adinauer

@adinauer adinauer commented Aug 24, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Exclude URL query parameters and fragments from Ktor HTTP client span descriptions.

Parse each request URL through the shared resolver-aware UrlUtils path and use its URL-only representation for the description. Keep the raw URL for trace propagation decisions and do not introduce query or fragment span data.

💡 Motivation and Context

Ktor client spans previously used the complete request URL as their description. This could attach sensitive query values despite the Data Collection URL-query policy and differed from OkHttp, Spring HTTP clients, OpenFeign, and Apollo, which already omit query parameters and fragments from descriptions.

Refs #5666

💚 How did you test it?

  • ./gradlew :sentry-ktor-client:test --tests 'io.sentry.ktorClient.SentryKtorClientPluginTest'
  • ./gradlew spotlessApply apiDump
  • git diff --check

📝 Checklist

  • I added GH Issue ID & Linear ID
  • 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.

🔮 Next steps

Continue the remaining Data Collection configuration and release-gate work.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Parse Ktor client request URLs through the shared URL utility so span descriptions omit query parameters and fragments. Keep the raw URL for trace propagation and avoid introducing query span data.

Refs #5666

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

This was referenced Aug 12, 2026
@sentry

sentry Bot commented Aug 24, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.48.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 366.13 ms 421.52 ms 55.39 ms
Size 0 B 0 B 0 B

Previous results on branch: fix/data-collection-ktor-span-description

Startup times

Revision Plain With Sentry Diff
b4250aa 325.47 ms 381.65 ms 56.18 ms

App size

Revision Plain With Sentry Diff
b4250aa 0 B 0 B 0 B

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.

1 participant