Skip to content

Add breadcrumbs filter option #672

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

Closed
skeggse opened this issue Aug 2, 2016 · 3 comments
Closed

Add breadcrumbs filter option #672

skeggse opened this issue Aug 2, 2016 · 3 comments

Comments

@skeggse
Copy link

skeggse commented Aug 2, 2016

Right now, I'm filtering out some analytics xhrs from the breadcrumbs by using the dataCallback parameter:

function filterCrumbs(crumb) {
  // For example.
  return crumb.category !== 'xhr' || !crumb.data.url.startsWith('https://example.com');
}

Raven.config({
  // ...
  dataCallback(payload) {
    try {
      if (!payload.breadcrumbs) return payload;
      payload.breadcrumbs.values = payload.breadcrumbs.values.filter(filterCrumbs);
    } catch (err) {
      // Don't block logging on xhr filtering.
    }
    return payload;
  }
});

It would be convenient if there were a filterCrumbs option, or something like it - payload.breadcrumbs.values isn't explicitly documented, and as such it feels brittle.

@benvinegar
Copy link
Contributor

Hey Mixmax gang – breadcrumb configuration is on my radar, starting with just flat-out turning them on/off. This makes sense too.

@benvinegar
Copy link
Contributor

Just a heads up that 3.5.0 now collects 100 breadcrumbs by default (you can reduce by changing maxBreadcrumbs). We also have breadcrumb filtering coming to the Sentry UI soon. I'd see if those changes will make this tolerable for you.

@elicwhite
Copy link
Contributor

We make a bunch of requests to an analytics endpoint as well. We also want to filter those out but want to do that before they count against the 100 breadcrumbs. I'm planning on opening a PR that adds another callback for filtering breadcrumbs.

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

3 participants