Repository navigation
Description
Part of #5420. Phase 3 — deprecation.
Deprecate SentryOptions.SendDefaultPii (src/Sentry/SentryOptions.cs:333):
- Changelog + doc-comment deprecation with the
DataCollectionmigration snippet that comes closest toSendDefaultPii = false(see the callout below). - Semantics:
SendDefaultPii = true≈ new defaults; if both options are set,SendDefaultPiiis ignored.
Release-note callout (moved from #5438)
The spec defaults are already live for anyone who calls ConfigureDataCollection (#5853, #5885), so the deprecation's migration note has to warn that ConfigureDataCollection(_ => { }) collects more than SendDefaultPii = false: user info, cookies, GraphQL documents and variables, and the headers and URL fragment on HTTP client failed-request events are all on.
The snippet can only approximate SendDefaultPii = false, so the note should name what differs:
UserInfo = false,Cookies = KeyValueCollectionBehavior.OffandGraphQL.Document/.Variables = falsematch it.- Headers can't match.
SendDefaultPii = falsecollects request headers server-side (deny list) but sends none on failed-request events, whileHttpHeaders.Requestsets both at once. The URL fragment on failed-request events has the same split withUrlQueryParams. - Opting in sanitizes database statements, and nothing turns that off.
HttpBodiesonly gates incoming request bodies today, still bounded byMaxRequestBodySize. Nothing reads the other three directions.
Open question: [Experimental]
ConfigureDataCollection and DataCollectionOptions are still [Experimental]. Deprecating SendDefaultPii in favour of an experimental API sends a mixed message under either option below, so decide here whether the attribute comes off as part of this issue.
How other SDKs played it
The three reference SDKs diverge, so this is a genuine choice rather than a convention to copy:
| SDK | Posture |
|---|---|
| JavaScript | Deprecated in 10.57.0 (JSDoc only, no runtime warning), removed in v11 |
| Java | Deprecated with an explicit "will be removed in the next major (v9)" alert in the docs |
| Python | Explicitly not deprecating yet — "that won't happen until a future major version. Until then, send_default_pii remains fully supported" |
Decision needed: [Obsolete] on main, or signpost only
[Obsolete] produces compiler warnings that break consumers building with TreatWarningsAsErrors — a cost JSDoc @deprecated does not have. And this repo has a relevant precedent: #5629 marked three options [Obsolete] on main ahead of a 7.0.0 change and was closed, the convention being that a "do X in the next major" conclusion is implemented as X itself on the version7 branch rather than substituted with an [Obsolete] on main.
That precedent is not a perfect match — here the spec roadmap has a real deprecation phase, so an [Obsolete] would be signposting rather than a substitute for the removal (which #5439 does on version7). Still, it needs maintainer buy-in before landing. Options:
- Docs/changelog deprecation only on
main(XML doc comment + the migration snippet), removal onversion7via DataCollection phase 5: remove SendDefaultPii (next major) #5439. Closest to the feat:SentryOptions.ScopeObserver,EnableScopeSyncandCrashedLastRunare obsolete #5629 convention and to Python's posture. [Obsolete]onmainwith a clear message pointing atDataCollection, removal onversion7. Matches JS/Java, at the cost of consumer build warnings.
The Phase 2 migrations are all closed, so this is no longer blocked.
Activity
linear-code commentedon Jul 22, 2026
NET-772