SentrySigrid HuemerExplainer
From one switch to a control panel: meet `dataCollection`
Summary
Sentry is replacing the JavaScript SDK boolean option sendDefaultPii with dataCollection, a category-level control for automatically collected data. In version 11, dataCollection becomes the default, sendDefaultPii is removed, and several categories—including user information, cookies, HTTP bodies, GenAI inputs and outputs, database query data, and stack-frame variables—are collected by default. The post distinguishes PII, which is collected by default, from sensitive credentials, whose values in collected headers are filtered automatically; manually attached data remains unaffected. Developers can preserve v10’s restrictive baseline or select true, false, allow lists, and deny lists for supported fields, while beforeSend and beforeSendSpan handle additional filtering. Because v11 also enables span streaming by default, span drops move to ignoreSpans, and existing withStreamedSpan wrappers should be removed.
Context
The boolean sendDefaultPii option could only enable or disable broad collection, making it impossible to collect one useful category while excluding another. JavaScript SDK v11 also changes the default behavior: dataCollection collects more categories than an unset or false sendDefaultPii did in v10, requiring review before upgrading.
Approach / What changed
dataCollection provides category-level controls for automatically collected data, including booleans, allow lists, and deny lists for supported fields. Existing event and span hooks handle more specific filtering: beforeSend can modify or drop error events, beforeSendSpan can modify spans, and ignoreSpans can drop spans in v11 streaming mode.
Takeaways
With JavaScript SDK v11, an unset dataCollection collects more than the previous restrictive v10 default, including request and response bodies, user information, cookies, GenAI inputs and outputs, and database query data.
Manually attached data is still sent even when its category is disabled; for example, setting userInfo to false does not prevent explicitly supplied data from Sentry.setUser(...) from being sent.
Span streaming is enabled by default in v11. Span modifications use beforeSendSpan, span drops use ignoreSpans, and beforeSendTransaction or ignoreTransactions are unavailable once streaming is active.
Source and freshness
- Source
- blog.sentry.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.