Skip to content

initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance methods for @sentry/bun #14504

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

Open
Thanaen opened this issue Nov 27, 2024 · 7 comments
Labels
Feature Package: bun Issues related to the Sentry Bun SDK

Comments

@Thanaen
Copy link

Thanaen commented Nov 27, 2024

Problem Statement

@sentry/node calls the “initWithoutDefaultIntegrations” method combined with “getDefaultIntegrationsWithoutPerformance” to initialize Sentry in “error handling” mode only.

It would appear that the @sentry/bun package does not expose these methods, but @sentry/bun users would also benefit from them.

Would it be possible to add them?

An alternative solution would be to use @sentry/node with bun, but I'm not sure about the side effects.

Thanks!

Solution Brainstorm

Add “initWithoutDefaultIntegrations” and “getDefaultIntegrationsWithoutPerformance” methods to @sentry/bun

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 27, 2024
@Thanaen
Copy link
Author

Thanaen commented Nov 27, 2024

(The purpose of this feature would be to reduce Sentry's impact on bun performance, as mentioned in this issue: #12561)

@chargome
Copy link
Member

Hi @Thanaen, thanks for reaching out. You could just filter the integrations based on your needs like this:

Sentry.init({
  // ...
  integrations: function (integrations) {
    // integrations will be all default integrations
    return integrations.filter(function (integration) {
      return integration.name !== "Breadcrumbs";
    });
  },
});

docs here

@Thanaen
Copy link
Author

Thanaen commented Nov 27, 2024

This could be a good workaround, even if it's less simple to use than the methods provided for Node.js!

Does it allow tree-shaking of disabled integrations?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 27, 2024
@chargome
Copy link
Member

chargome commented Nov 27, 2024

@Thanaen yes this should be tree-shakable unfortunately this would not be treeshakable. You would need to provide your own client instead, similar to https://docs.sentry.io/platforms/javascript/configuration/tree-shaking/#tree-shaking-default-integrations. In your case this would be a BunClient though. Sorry for the confusion!

@Thanaen
Copy link
Author

Thanaen commented Nov 27, 2024

Ok!

This means that Sentry users who use Bun should maintain a list of integrations to disable if they don't want to use tracing and performance analysis, it's not ideal, but I can live with it for now

@chargome
Copy link
Member

chargome commented Dec 2, 2024

@Thanaen updated my comment above!

@Thanaen
Copy link
Author

Thanaen commented Dec 2, 2024

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Package: bun Issues related to the Sentry Bun SDK
Projects
Status: No status
Development

No branches or pull requests

4 participants