Sentry-javascript: Best way to turn off auto-breadcrumbs

Created on 30 Oct 2018  路  6Comments  路  Source: getsentry/sentry-javascript

Is this the quickest way to turn off default breadcrumbs?

  Sentry.init({
        integrations: [new Sentry.Integrations.Breadcrumbs({
          console: false,
          dom: false,
          xhr: false,
          fetch: false,
          beacon: false,
          history: false,
        })]
      })

Documenting here in case anyone else is wondering as can't find specific docs...

Most helpful comment

No, just remove Breadcrumbs integration - https://docs.sentry.io/platforms/javascript/#removing-an-integration :)

Sentry.init({
  dsn: 'https://[email protected]/1',
  integrations(integrations) {
    return integrations.filter(integration => integration.name !== 'Breadcrumbs');
  }
});

All 6 comments

No, just remove Breadcrumbs integration - https://docs.sentry.io/platforms/javascript/#removing-an-integration :)

Sentry.init({
  dsn: 'https://[email protected]/1',
  integrations(integrations) {
    return integrations.filter(integration => integration.name !== 'Breadcrumbs');
  }
});

@kamilogorek It looks like you should actually be filtering on integration.name not integration.id as the integration objects do not have a key named id. Also the documentation needs to be updated.

@pljeskavica right, thanks for catching that! PR https://github.com/getsentry/sentry-docs/pull/568

This does not work anymore :/

@StarryFire how so? Can you provide your configuration? It should still work just fine

This does not work anymore :/

I just tried and it works. Check if you spelled it correctly, that was my mistake xD

Was this page helpful?
0 / 5 - 0 ratings