Skip to content

Provide a restrictive dataCollection baseline that also covers keys added in minor releases #25659

Open

Description

@JPeer264

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:

  1. No single option keeps the v10 behavior. Users must copy the full object from the migration guide and keep it up to date.
  2. When a minor release adds a new dataCollection key, 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 stackFrameVariables and frameContextLines, 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, mcp falls back to genAI. If the exported object sets mcp to false, a user who sets genAI: { inputs: true } no longer gets MCP inputs, and no warning tells them. One alternative is a flag that the SDK resolves, for example dataCollection: { defaults: 'off' }. Then resolveDataCollectionOptions can apply the fallbacks before it turns off the keys that are not set.

Activity

  1. linear-code commented on Oct 22, 2026

    @linear-code
  2. JPeer264 commented on Oct 30, 2026

    @JPeer264
    MemberAuthor

    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 dataCollection options, like we recently did with .genAI and the new .mcp option, 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 .genAI option for MCP calls when .mcp is not set, but use .mcp when 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 dataCollection you can set the following in TypeScript apps: https://github.com/JPeer264/sentry-repros/blob/4906065c78deab58f52c70f506a9d1a9f2a7c334/src/index.ts#L22

    Please upvote this issue in case it is important to you, or leave some more detailed feedback in the form of a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    javascriptPull requests that update javascript code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions