Provide a restrictive dataCollection baseline that also covers keys added in minor releases #25659
Copy link
Copy link
Open
Labels
javascriptPull requests that update javascript codePull requests that update javascript code
Description
Problem
In v11, dataCollection replaces sendDefaultPii. Its defaults collect more data than v10 did. To keep the v10 behavior, users must set each key to a restrictive value manually (see Keeping the v10 default behavior).
This causes two problems:
- No single option keeps the v10 behavior. Users must copy the full object from the migration guide and keep it up to date.
- When a minor release adds a new
dataCollectionkey, the new key collects by default. Users who turned off each key manually start to send the new data after they upgrade, with no change to their config.
Proposal
Export an object that we maintain, with a restrictive value for each key. Users spread it and turn on only what they want. A new key is then off by default:
Sentry.init({
dataCollection: {
...Sentry.dataCollectionOff, // name TBD
genAI: { inputs: true, outputs: false },
},
});Open questions
- Which baseline do we use: all keys off, or the v10 defaults? "All off" also turns off
stackFrameVariablesandframeContextLines, which v10 collected. - Some keys replace an older key in a minor release and fall back to it when they are not set. For example,
mcpfalls back togenAI. If the exported object setsmcptofalse, a user who setsgenAI: { inputs: true }no longer gets MCP inputs, and no warning tells them. One alternative is a flag that the SDK resolves, for exampledataCollection: { defaults: 'off' }. ThenresolveDataCollectionOptionscan apply the fallbacks before it turns off the keys that are not set.
Reacted by Jonas Thelemann, Mikhail Bashkirov, michellangeveld and Brandon Weng
Metadata
Metadata
Assignees
Labels
javascriptPull requests that update javascript codePull requests that update javascript code
Activity
linear-code commentedon Oct 22, 2026
JS-3988
JPeer264 commentedon Oct 30, 2026
We discussed this a bit further internally and came to the conclusion that it is best to first collect more feedback to understand the needs for this issue, before we jump into the implementation.
In rare occasions, where we split up certain
dataCollectionoptions, like we recently did with.genAIand the new.mcpoption, we strive for having a smooth upgrade and not implement breaking changes in a minor. In the scenario, as written above, we would fallback to the.genAIoption for MCP calls when.mcpis not set, but use.mcpwhen it is set. In the next major the fallback will then probably be removed. Data collection changes will also always be highlighted in our changelogs.In case, you still want to explicitly set all options in
dataCollectionyou can set the following in TypeScript apps: https://github.com/JPeer264/sentry-repros/blob/4906065c78deab58f52c70f506a9d1a9f2a7c334/src/index.ts#L22Please upvote this issue in case it is important to you, or leave some more detailed feedback in the form of a comment.