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
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