Skip to content

Commit 3d6e248

Browse files
benvinegarLewisJEllis
authored andcommitted
Add breadcrumbs to docs (#780)
* Add breadcrumbs to docs * Fix section heading, tweak "instrumenting" sentence * Address @LewisJEllis' comments
1 parent aea180b commit 3d6e248

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

docs/index.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ Other similar methods are ``Raven.setExtraContext`` and
8383
``Raven.setTagsContext`` as well as ``Raven.context``. See
8484
:ref:`raven-js-additional-context` for more info.
8585

86+
Breadcrumbs
87+
-----------
88+
89+
Breadcrumbs are browser and application lifecycle events that are helpful in understanding the state of the application
90+
leading up to a crash.
91+
92+
By default, Raven.js instruments browser built-ins and DOM events to automatically collect a few useful breadcrumbs
93+
for you:
94+
95+
* XMLHttpRequests
96+
* URL / address bar changes
97+
* UI clicks and keypress DOM events
98+
* console log statements
99+
* previous errors
100+
101+
You can also record your own breadcrumbs. For more information, see :ref:`raven-js-recording-breadcrumbs`.
102+
86103
Dealing with Minified Source Code
87104
---------------------------------
88105

docs/usage.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,51 @@ functions all allow passing additional data to be tagged onto the error.
161161
Raven.setExtraContext({ foo: "bar" })
162162
163163
164+
.. _raven-js-recording-breadcrumbs:
165+
166+
Recording Breadcrumbs
167+
---------------------
168+
169+
Breadcrumbs are browser and application lifecycle events that are helpful in understanding the state of the application
170+
leading up to a crash.
171+
172+
By default, Raven.js instruments browser built-ins and DOM events to automatically collect a few useful breadcrumbs
173+
for you:
174+
175+
* XMLHttpRequests
176+
* URL / address bar changes
177+
* UI clicks and keypress DOM events
178+
* console log statements
179+
* previous errors
180+
181+
You can also record your own breadcrumbs:
182+
183+
.. code-block:: javascript
184+
185+
Raven.captureBreadcrumb({
186+
message: 'Item added to shopping cart',
187+
category: 'action',
188+
data: {
189+
isbn: '978-1617290541',
190+
cartSize: '3'
191+
}
192+
});
193+
194+
To learn more about what types of data can be collected via breadcrumbs, see the `breadcrumbs client API specification
195+
<https://docs.sentry.io/learn/breadcrumbs/>`_.
196+
197+
Note that you can also disable automatic breadcrumb collection entirely or disable specific collectors:
198+
199+
.. code-block:: javascript
200+
201+
Raven.config('___PUBLIC_DSN___', {
202+
autoBreadcrumbs: {
203+
xhr: false
204+
}
205+
});
206+
207+
For more on configuring breadcrumbs, see :doc:`config`.
208+
164209
Getting Back an Event ID
165210
------------------------
166211

0 commit comments

Comments
 (0)