Skip to content

Cannot change/override breadcrumbs integration options #1981

Closed
@d7ark

Description

@d7ark

Package + Version

  • [*] @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.0.2

Description

Simple demo: https://github.com/d7ark/sentry-breadcrumbs-issue (need to provide sentry dsn in index.js).

I cannot find way to override Breadcrumbs integration options. Way provided in documentation is not working.

integrations: [new Sentry.Integrations.Breadcrumbs({ console: false })].

Solution from example app is also not working.

I have a hunch this is because the defaultIntegrations are creating new Integrations.Breadcrumbs which adds event listeners with default options (everything true) and there's no way to remove those listeners. But Im not sure.

I've found a workaround using beforeBreadcrumb but I'd prefer to use intented way (Breadcrumbs integration with { dom: false }).

  // workaround using beforeBreadcrumb
  Sentry.init({
    beforeBreadcrumb: removeUiBreadcrumbs,
    dsn: SENTRY_DSN,
  });

  function removeUiBreadcrumbs(breadcrumb) {
    return breadcrumb.category.startsWith('ui.') ? null : breadcrumb;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions