Skip to content

Commit 22a5976

Browse files
committed
Add sample example
1 parent d40a097 commit 22a5976

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/tips/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Pro Tips™
22
=========
33

4+
45
Decluttering Sentry
56
~~~~~~~~~~~~~~~~~~~
67

@@ -62,3 +63,17 @@ The community has compiled a list of common ignore rules for common things, like
6263
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i
6364
]
6465
};
66+
67+
68+
Sampling Data
69+
~~~~~~~~~~~~~
70+
71+
It happens frequently that errors sent from your frontend can be overwhelming. One solution here is to only send a sample of the events that happen. You can do this via the ``shouldSendCallback`` setting:
72+
73+
.. code-block:: javascript
74+
75+
shouldSendCallback: function(data) {
76+
// only send 10% of errors
77+
var sampleRate = 10;
78+
return (Math.random() * 100 <= sampleRate);
79+
}

0 commit comments

Comments
 (0)