You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(core)!: Remove sendDefaultPii in favor of dataCollection (#22918)
Removes all occurrences of `sendDefaultPii` and also updates the
migration docs.
Closes#22708
---------
Co-authored-by: Charly Gomez <charly.gomez1310@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: MIGRATION.md
+34-34Lines changed: 34 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,64 +96,64 @@ For most users, day-to-day tracing is **unchanged**.
96
96
97
97
Affected SDKs: All SDKs.
98
98
99
-
The `sendDefaultPii` option was **removed** and replaced by a more granular `dataCollection` option that controls each category of collected data individually.
99
+
> **Heads up — this is a behavior change, not just a renamed option.**
100
+
> In v10, leaving `sendDefaultPii` unset behaved like `sendDefaultPii: false` (restrictive).
101
+
> In v11, leaving `dataCollection` unset collects the categories below **by default**.
102
+
> Review this before upgrading if you'd rather not collect HTTP request data, database queries, or GenAI inputs/outputs.
100
103
101
-
The **default behaviour is now more permissive**. In v10, with neither `sendDefaultPii`nor`dataCollection` set, the SDK behaved like `sendDefaultPii: false`. In v11, the `dataCollection` defaults apply out of the box:
104
+
We've replaced `sendDefaultPii`with`dataCollection`, which controls each category of collected data individually. The default is now more permissive than in v10.
> Sensitive values (keys, tokens, auth headers, etc.) are always filtered out regardless of these settings.
118
+
> Sentry's built-in sensitive-data filtering still applies. Review your data-scrubbing config for categories that may contain sensitive values — especially request/response bodies.
115
119
116
-
Migration:
120
+
#### If you previously set `sendDefaultPii: true`
121
+
122
+
The v11 default matches this, so just remove the option:
117
123
118
124
```js
119
-
// before (v10) — collect the default set of PII
120
-
Sentry.init({
121
-
sendDefaultPii:true,
122
-
});
125
+
// v10
126
+
Sentry.init({ sendDefaultPii:true });
123
127
124
-
// after (v11) — this is now the default; you can remove the option entirely,
125
-
// or opt into specific categories explicitly:
126
-
Sentry.init({
127
-
dataCollection: {
128
-
userInfo:true,
129
-
cookies:true,
130
-
httpHeaders: { request:true, response:true },
131
-
urlQueryParams:true,
132
-
genAI: { inputs:true, outputs:true },
133
-
},
134
-
});
128
+
// v11 — same behavior is now the default
129
+
Sentry.init({});
135
130
```
136
131
137
-
If you previously relied on the restrictive default (`sendDefaultPii: false` or unset) and want to
138
-
keep collecting as little data as possible, you now need to opt out explicitly:
132
+
#### If you want to keep the v10 default behavior
133
+
134
+
Set the baseline explicitly. **Don't leave `dataCollection` unset** — that now enables broader collection.
139
135
140
136
```js
141
-
//after (v11) — restrict data collection to the v10-like minimum
0 commit comments