bugsnag / bugsnag-js

JavaScript error handling tool for BugSnag. Monitor and report JavaScript bugs & errors.
https://docs.bugsnag.com/platforms/javascript
MIT License
852 stars 251 forks source link

Automatic breadcrumb support #132

Closed snmaynard closed 8 years ago

snmaynard commented 8 years ago

Lets add support for automatic breadcrumbs for some events and give an interface to add more.

This might require a server side component too!

jmshal commented 8 years ago

Sorry if I'm missing something, but what do you mean by "breadcrumbs for some events"?

snmaynard commented 8 years ago

Things like push/replace/popstate or anything else that we can sensible automate. We could capture clicks possibly (with an optional opt in?). I havent thought much about the appropriateness of this or security implications of various events. It would just be cool to instrument people's applications.

I wonder if we could add breadcrumbs for events that the app has bound listeners for.

jmshal commented 8 years ago

I absolutely agree, it would be a seriously useful thing to implement, especially if it was 1st class with Bugsnag (backend support).

I do wonder whether the push/replace/popstate stuff is better handled in wrapper notifiers, like angular-bugsnag and ember-bugsnag for example. They have the ability to access any necessary data without adding any bulk to the main library.

As for clicks, maybe adding an attribute which can be attached to any element which keeps track of key events developers which to keep an eye on, in case they lead to errors. However I'm having a hard time trying to figure out whether that information would help validate an error or add any additional useful information to the error report.

I'm just thinking in the case of large single page apps, where there are many tasks going on at once, maybe having users interactions (a breadcrumb) attached would lead to even more confusion? Not sure.

Love the idea. I'd really love to see what could be done with this. It definitely has the potential of adding clarity to errors.

snmaynard commented 8 years ago

I'm going to close this to track it in our other system!

barkerja commented 8 years ago

I hate to revive a dead issue, but this gets my 👍. Have been a longtime Bugsnag user (over 2 years now), and this is one sorely missing feature that has me considering other services to track frontend issues.

foxyblocks commented 8 years ago

I feel your pain. We are currently prototyping this feature internally, and hope to have a solution available soon. Just so we have a sense, are there any particular types of browser events that are of high importance for you so we can prioritize them in the automatic tracking?

barkerja commented 8 years ago

For starters, just simple action tracking (state change, element clicking, console logging, etc.) to help tell the story of what led to the thrown error.

I guess order of importance: