Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to opt-out of default integrations #14950

Open
mydea opened this issue Jan 9, 2025 · 0 comments
Open

Make it easier to opt-out of default integrations #14950

mydea opened this issue Jan 9, 2025 · 0 comments

Comments

@mydea
Copy link
Member

mydea commented Jan 9, 2025

Description

Today, it is rather annoying to opt-out of individual default integrations. You have to do something like this:

Sentry.init({
  integrations: (integrations) => integrations.filter(integration => intergation.name !== 'InboundFilters')
});

This becomes even more annoying when you also want to add pluggable intergations, as then instead of this: integrations: [Sentry.replayIntegration()] you suddenly have to do this:

Sentry.init({
  integrations: (integrations) => {
    integrations.push(Sentry.replayIntegration);
    return integrations.filter(integration => intergation.name !== 'InboundFilters');
  }
});

which really does not feel ideal.

I propose to add a new way to disable individual default integrations, similar to how https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node does this:

You can fully opt-out of default integrations via defaultIntegrations: false. In addition to this, we can allow users to pass an object, which allows to disable individual keys:

Sentry.init({
  defaultIntegrations: {
    'InboundFilters': false,
    'GlobalHandlers': false
  },
  // you can then continue to add integrations as normally
  integrations: [Sentry.replayIntegration()]
});

This would be backwards compatible, but simply be a new and easier way to solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant