Bugsnag-js: [Feature] Ability to filter breadcrumbs generated

Created on 10 Dec 2019  路  4Comments  路  Source: bugsnag/bugsnag-js

Summary
Ability to filter breadcrumbs generated

Type
Feature

Description
Right now you can enable/disable breadcrumbs based on type that is awesome.

I would like the ability to have interceptor when breadcrumb is added.

_Why_

  1. My application uses different tracking tools that generate XHR Requests that I do not want to appear in breadcrumbs as it pollutes the flow with data that aren't helpful.
  2. In development because I have webpack dev server requests are made to /sockjs-node/info that I also would like to filter out.
  3. There are some user interactions that I do not want to appear.

Note: At this moment I'm filtering breadcrumbs using beforeSend, but this has the limitation that I can have a maximum of 40 breadcrumbs and I will loose what is important.

Most helpful comment

I'd love to explore opening this again. I do like the onBreadcrumb event listener, but it would be great if they could contain actual events attached to the callback.

The use case is that we want to be able to filter out any data that has a specific data attribute on it or a parent element (our use case is to hide PII). With the current implementation, we are given the selector, but it only gives us class/id information about the element and sometimes that "click" on an element triggers a change of classes so the selector that is provided no longer matches the element that was clicked on.

I'm thinking that it could be added without affecting the API (no breaking changes) if it is provided as a secondary argument.

All 4 comments

Hi @darkyndy, we're implementing onBreadcrumb callbacks in the next major version. This should give you exactly what you want.

Nice to hear that is on the priorities.

Could I help with coding for this feature?

It's actually already on the v7 branch, but it's a part of a large ongoing refactor which will be released at some point in the new year. Thanks though!

I'd love to explore opening this again. I do like the onBreadcrumb event listener, but it would be great if they could contain actual events attached to the callback.

The use case is that we want to be able to filter out any data that has a specific data attribute on it or a parent element (our use case is to hide PII). With the current implementation, we are given the selector, but it only gives us class/id information about the element and sometimes that "click" on an element triggers a change of classes so the selector that is provided no longer matches the element that was clicked on.

I'm thinking that it could be added without affecting the API (no breaking changes) if it is provided as a secondary argument.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShawnCholeva picture ShawnCholeva  路  6Comments

nathanwelch picture nathanwelch  路  6Comments

mattimatti picture mattimatti  路  4Comments

flrnt picture flrnt  路  6Comments

foxyblocks picture foxyblocks  路  5Comments