Skip to content

feat(android): [Data Collection 23] Add manifest configuration - #6038

Draft
adinauer wants to merge 3 commits into
feat/data-collection-external-optionsfrom
feat/data-collection-android-manifest
Draft

feat(android): [Data Collection 23] Add manifest configuration#6038
adinauer wants to merge 3 commits into
feat/data-collection-external-optionsfrom
feat/data-collection-android-manifest

Conversation

@adinauer

@adinauer adinauer commented Sep 2, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Parse flattened Data Collection settings from Android manifest metadata.

Support user information, HTTP body directions, cookies, request and response headers, URL query parameters, GraphQL document and variables, and database query data. Apply only metadata fields that are present, preserving existing programmatic configuration and the unconfigured legacy state when the namespace is absent. Partial key-value settings preserve the existing mode or terms that were not specified.

Expose the internal DataCollection constructor and explicit-configuration check so Android can parse metadata into an unconfigured temporary object before merging it transactionally.

💡 Motivation and Context

Android applications commonly configure the SDK through AndroidManifest.xml. Data Collection needs equivalent manifest support without replacing settings supplied through other configuration layers or accidentally opting legacy applications into the new defaults.

Refs #5666

💚 How did you test it?

  • ./gradlew :sentry:test --tests '*DataCollectionTest'
  • ./gradlew :sentry-android-core:testDebugUnitTest --tests '*ManifestMetadataReaderTest'
  • ./gradlew :sentry-android-core:check
  • ./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.

🔮 Next steps

Add Spring Boot binding coverage and Data Collection configuration documentation in follow-up PRs.

#skip-changelog

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

Parse flattened Data Collection metadata while preserving existing option values for fields omitted from the manifest. Expose internal configuration-state helpers across SDK modules so Android can distinguish absent metadata from explicit settings.\n\nRefs #5666\nCo-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 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.

@github-actions

github-actions Bot commented Sep 2, 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 db5a45e

@sentry

sentry Bot commented Sep 2, 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 Sep 2, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 359.30 ms 425.77 ms 66.47 ms
Size 0 B 0 B 0 B

Baseline results on branch: feat/data-collection-external-options

Startup times

Revision Plain With Sentry Diff
d3db9cd 322.28 ms 378.68 ms 56.40 ms

App size

Revision Plain With Sentry Diff
d3db9cd 0 B 0 B 0 B

Previous results on branch: feat/data-collection-android-manifest

Startup times

Revision Plain With Sentry Diff
3dd638d 297.55 ms 374.40 ms 76.85 ms

App size

Revision Plain With Sentry Diff
3dd638d 0 B 0 B 0 B

adinauer and others added 2 commits September 2, 2026 11:44
Merge the conflict-resolved cookie policy through the remaining stacked branches.

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

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hey sorry to block, but i think we need to rebase (see my note) before we can proceed with the review.

Comment thread sentry/api/sentry.api

public final class io/sentry/DataCollection {
public fun <init> ()V
public fun <init> (Z)V

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

weird, there's only one constructor. this makes it seem like there are two

}
}

private static @Nullable DataCollection readDataCollection(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@romtsn recently refactored all the methods in this class that read from the manifest in order to allow a performance improvement from the Gradle side. PR link It looks like the changes aren't in this PR. Can you see if a rebase fixes that? Without a rebase it is likely this code would crash when run together with the Gradle plugin.

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.

2 participants