fix(ktor): [Data Collection 20] Exclude query parameters from span descriptions - #5983
Draft
adinauer wants to merge 2 commits into
Draft
Conversation
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>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
This was referenced Aug 12, 2026
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
UrlUtilspath 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 apiDumpgit diff --check📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue the remaining Data Collection configuration and release-gate work.
#skip-changelog