feat(core): [Data Collection 25] Apply file path policy - #6075
Open
adinauer wants to merge 1 commit into
Open
Conversation
Add the specification-defined filePaths option across programmatic, external, Spring Boot, and Android manifest configuration. Gate automatically captured File I/O paths through the resolved policy while preserving sendDefaultPii when Data Collection is absent.\n\nRefs #5666
Contributor
|
This was referenced Sep 9, 2026
📲 Install BuildsAndroid
|
adinauer
marked this pull request as ready for review
September 9, 2026 06:05
9 tasks
runningcode
approved these changes
Sep 9, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
Looks good but worth checking my comment. And also worth checking other PRs in the stack for the kotlin synthetic accessor mismatches
| return filePaths; | ||
| } | ||
|
|
||
| public void setFilePaths(final boolean filePaths) { |
Contributor
There was a problem hiding this comment.
See my above comment. This is for better consistency between the getter and setter and also so make the kotlin synthetic setter work.
Suggested change
| public void setFilePaths(final boolean filePaths) { | |
| public void setFilePaths(@Nullable Boolean filePaths) { |
| graphql.setDocument(true) | ||
| graphql.setVariables(false) | ||
| setDatabaseQueryData(true) | ||
| setFilePaths(true) |
Contributor
There was a problem hiding this comment.
in order to be able to use the kotlin synthetic property, the setter has to have the same signature as the getter. See my comment below on how to do this
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
Add the specification-defined
dataCollection.filePathsoption, defaulting totruein explicit Data Collection mode. Support programmatic, external, Spring Boot, and Android manifest configuration.Apply the resolved policy to automatic file names and paths captured by File I/O instrumentation. When Data Collection is absent, the resolver continues to use
sendDefaultPii, preserving existing behavior. Disabling file path collection retains non-identifying metadata such as file extensions and byte counts.💡 Motivation and Context
File and directory paths can contain user names, tenant identifiers, and document names. This gives File I/O instrumentation a dedicated privacy control instead of leaving it governed only by the coarse legacy option.
Implements the candidate specification from sentry-docs#18819.
Refs #5666
💚 How did you test it?
./gradlew :sentry:test --tests='*DataCollectionTest*' --tests='*DataCollectionResolverTest*' --tests='*ExternalOptionsTest*' --tests='*SentryOptionsTest*' --tests='*SentryFileReaderTest*' --info./gradlew :sentry:test --tests='io.sentry.instrumentation.file.*' --info./gradlew :sentry-android-core:testReleaseUnitTest --tests='*ManifestMetadataReaderTest*' --info./gradlew :sentry-spring-boot:test :sentry-spring-boot-jakarta:test :sentry-spring-boot-4:test --tests='*SentryAutoConfigurationTest*' --info./gradlew spotlessApply apiDumpgit diff --check📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Merge this PR into the collection branch before squash-merging the collection PR into
main.#skip-changelog