Skip to content

feat(core): [Data Collection 1] Add configuration types#5760

Draft
adinauer wants to merge 2 commits into
feat/data-collectionfrom
feat/data-collection-foundation
Draft

feat(core): [Data Collection 1] Add configuration types#5760
adinauer wants to merge 2 commits into
feat/data-collectionfrom
feat/data-collection-foundation

Conversation

@adinauer

@adinauer adinauer commented Jul 14, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Add the foundational public types for configuring automatic data collection:

  • DataCollection, with nullable raw overrides and nested HTTP-header and GraphQL settings
  • KeyValueCollectionBehavior, with mutually exclusive off, deny-list, and allow-list modes
  • HttpBodyType, covering the four specification-defined HTTP directions

The public DataCollection() constructor represents an explicit object, including an explicit empty configuration. A package-private constructor supports the unconfigured instance that SentryOptions will own in the next stack PR. Mutable collection inputs are copied and exposed as immutable values.

This PR intentionally does not expose the model through SentryOptions or change runtime collection behavior.

💡 Motivation and Context

Establish the Java-shaped configuration model required by the Data Collection specification before adding resolution, configuration sources, and integration enforcement. Nullable raw values preserve the distinction between omitted values and explicit false or empty values.

Refs #5666

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry:check
  • Unit tests cover explicit-empty state, SDK-owned unconfigured state, nullable overrides, nested overrides, immutable body sets, and key-value behavior construction.

📝 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 the always-present DataCollection instance and resolver to SentryOptions, then wire external configuration and integrations in subsequent stack PRs.

#skip-changelog

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

Add the public Data Collection model, key-value collection behavior, and HTTP body direction types. Preserve unset values internally so the resolver can distinguish legacy bridge mode from explicit configuration.

Refs #5666

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

github-actions Bot commented Jul 14, 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 c4ea3db

@adinauer adinauer mentioned this pull request Jul 14, 2026
8 tasks
@sentry

sentry Bot commented Jul 14, 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 Jul 14, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 305.81 ms 362.25 ms 56.44 ms
Size 0 B 0 B 0 B

Previous results on branch: feat/data-collection-foundation

Startup times

Revision Plain With Sentry Diff
c6eb158 302.35 ms 335.00 ms 32.65 ms

App size

Revision Plain With Sentry Diff
c6eb158 0 B 0 B 0 B

Avoid coupling the Data Collection configuration test to reference identity. The test only needs to verify that setting a nested header behavior marks the configuration explicit.

Refs #5666

Co-Authored-By: Claude <noreply@anthropic.com>
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