Skip to content

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

Merged
merged 3 commits into from
Nov 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,23 @@ Other similar methods are ``Raven.setExtraContext`` and
``Raven.setTagsContext`` as well as ``Raven.context``. See
:ref:`raven-js-additional-context` for more info.

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. For more information, see :ref:`raven-js-recording-breadcrumbs`.

Dealing with Minified Source Code
---------------------------------

Expand Down
45 changes: 45 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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

* 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({
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added category, and linked to the spec.

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
------------------------

Expand Down