-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add breadcrumbs to docs #780
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,51 @@ functions all allow passing additional data to be tagged onto the error. | |
Raven.setExtraContext({ foo: "bar" }) | ||
|
||
|
||
.. _raven-js-recording-breadcrumbs: | ||
|
||
Recording Breadcrumbs | ||
--------------------- | ||
|
||
Breadcrumbs are browser and application lifecycle events that are helpful in understanding the state of the application | ||
leading up to a crash. | ||
|
||
By default, Raven.js instruments browser built-ins and DOM events to automatically collect a few useful breadcrumbs | ||
for you: | ||
|
||
* XMLHttpRequests | ||
* URL / address bar changes | ||
* UI clicks and keypress DOM events | ||
* console log statements | ||
* previous errors | ||
|
||
You can also record your own breadcrumbs: | ||
|
||
.. code-block:: javascript | ||
|
||
Raven.captureBreadcrumb({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there anything other than message and data someone might want to include here? Maybe link to https://docs.sentry.io/clientdev/interfaces/breadcrumbs/ for info about level, category, etc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
message: 'Item added to shopping cart', | ||
category: 'action', | ||
data: { | ||
isbn: '978-1617290541', | ||
cartSize: '3' | ||
} | ||
}); | ||
|
||
To learn more about what types of data can be collected via breadcrumbs, see the `breadcrumbs client API specification | ||
<https://docs.sentry.io/learn/breadcrumbs/>`_. | ||
|
||
Note that you can also disable automatic breadcrumb collection entirely or disable specific collectors: | ||
|
||
.. code-block:: javascript | ||
|
||
Raven.config('___PUBLIC_DSN___', { | ||
autoBreadcrumbs: { | ||
xhr: false | ||
} | ||
}); | ||
|
||
For more on configuring breadcrumbs, see :doc:`config`. | ||
|
||
Getting Back an Event ID | ||
------------------------ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We list 5 thing here but 4 options on the config page, missing a config option corresponding to previous errors. Is this configurable? Should it be? Do we report prior errors as breadcrumbs when autobreadcrumbs are otherwise disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, right now you can't disable "error" breadcrumbs.
This is part oversight and part "people wanted to disable automatic breadcrumb collection because they didn't like overriding some built-ins" (particularly console). The error breadcrumbs don't require instrumentation.
I suppose I'll add it at some point. I added an issue: #782