feat(data-collection): create DataCollection option in client#6702
feat(data-collection): create DataCollection option in client#6702ericapisani wants to merge 16 commits into
Conversation
Codecov Results 📊✅ 90453 passed | ⏭️ 6298 skipped | Total: 96751 | Pass Rate: 93.49% | Execution Time: 327m 49s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 95.31%. Project has 2448 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.73% 89.75% +0.02%
==========================================
Files 192 193 +1
Lines 23823 23887 +64
Branches 8226 8244 +18
==========================================
+ Hits 21377 21439 +62
- Misses 2446 2448 +2
- Partials 1351 1351 —Generated by Codecov Action |
…ssors Replace the class-based DataCollection/KeyValueCollectionBehavior/ GenAICollection/HttpHeadersCollection API with plain TypedDicts (DataCollection, DataCollectionUserOptions, and per-category *CollectionBehaviour/*UserOptions types) defined in _types.py. Collection mode strings move from camelCase (denyList/allowList) to snake_case (deny_list/allow_list) to match Python convention, since this is a Python-only deviation from the spec that is never serialized to Sentry. Drop the should_collect_user_info/should_collect_gen_ai_inputs/ should_collect_gen_ai_outputs accessor methods and their module-level shortcuts in favor of reading data_collection fields directly, and drop the public sentry_sdk.DataCollection/GenAICollection/ HttpHeadersCollection/KeyValueCollectionBehavior exports. Revert the Unreleased CHANGELOG entry and README example for the prior class-based API.
1d30c98 to
8b9dedb
Compare
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0c3be5c. Configure here.

Support more granular PII controls via the
data_collectionoption as seen in the spec.These changes:
send_default_pii(which will eventually be legacy) was set.They don't currently hook up to anything in order to keep the size of this pull request somewhat sane.
Some high-level design decisions to call out:
This was done so that, once we've received the config from the user and have set defaults for values that weren't provided, we can avoid needing to constantly check if the value is
Nonewithin the SDK.provided_by_userproperty within theDataCollectiontypeThis is mainly to deal with spotlight-related logic within the client, which you can see here.
Fixes PY-2570
Fixes #6700