Repository navigation
feat(core): Add dataCollection.unlisted option - #25742
sentry-junior[bot] wants to merge 3 commits into
Conversation
Setting `defaults: 'off'` turns off every `dataCollection` field the user does not set, including fields added in later minor releases. MCP content still falls back to `genAI` when `mcp` is not set. Refs #25659 Co-Authored-By: Jan VamPeer Stöcklmair <jan.peer@sentry.io>
Co-Authored-By: Jan VamPeer Stöcklmair <jan.peer@sentry.io>
size-limit report 📦Compared: 695ffff (PR test merge using develop at 869b92c) Against: 869b92c (develop) · base run #63667 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 61 successful. See the run.
Successful checks
|
s1gr1d
left a comment
There was a problem hiding this comment.
I see some problems with the naming. Especially, that defaults has many meanings. The meaning we have here is "what to fall back to, when nothing is set". But when just reading defaults it could be read as "the default values".
What do you think of calling it unlisted: default | off?
The option name describes more what it's actually for ("the unlisted options") and either it's what we use by default (today, it happens to be "all on", but what if it isn't anymore in the future?) or one can just turn it off.
`defaults` reads like "the default values". `unlisted: 'default' | 'off'` names what the option controls: fields not listed in `dataCollection`.
dataCollection.defaults optiondataCollection.unlisted option
|
@JPeer264 maybe also check with other SDK teams (e.g. ask Erica from Python) what they think about this option. This should also land in the develop docs spec. |
It adds roughly 100bytes. I (Jan) would assume this is a lot in the browser, but it gives a real benefit for users who want to make sure they're not sending more data in the future as currently configured.
Users who want restrictive data collection in v11 currently have to list every
dataCollectionkey manually, and any key added in a later minor release silently starts collecting after an upgrade.dataCollection: { unlisted: 'off' }makes every key that isn't listed collect nothing, including future ones, so users only turn on what they need.We went with a flag that the SDK resolves instead of the exported object from the issue. Spreading an object would set
mcpexplicitly and break its fallback togenAI. With the flag,resolveDataCollectionOptionsstays the single place where defaults are applied, and MCP content still followsgenAIwhenmcpisn't set.'off'is a true "nothing" baseline, which also turns offstackFrameVariablesandframeContextLines. The migration guide's "keep v10 behavior" snippet now usesunlisted: 'off'with the v10 values layered on top.Fixes #25659
--
View Junior Session [Sentry]