We want to ensure that a single user can not flood the Sentry server with the same issue (or many issues) over and over.
It probably makes sense to add two things:
So agreeing !!1
10 hours after having deployed
There is a Sampling Data section in the docs. According to it, we can use something like:
shouldSendCallback: function(data) {
// only send 10% of errors
var sampleRate = 10;
return (Math.random() * 100 <= sampleRate);
}
However, that's not much useful, as we already get a sample of the errors when going beyond the quota.
On my side, I'm allocating a slot quota per minute / hour:
https://gist.github.com/oliviertassinari/114792721df8b7ef2cf2ecf3e4dea621
Thanks @oliviertassinari that seems good for filtering React useless and repetitive errors, will use something similar!
@slorber It's production tested at @doctolib. It might worth extracting that into a small library.
@MaxBittker The functionality in the linked PR is not included in the new sentry/browser
package? I just woke up with 21k events from the same user. Basically 1 per second...
I do not find allowDuplicates
settings in the new SDK. Should this feature work out of the box by now or do I have to still implement my own throttling solution as mentioned above? @slorber
@ms88privat https://docs.sentry.io/platforms/javascript/#dedupe
import * as Sentry from '@sentry/browser';
import * as Integrations from '@sentry/integrations';
Sentry.init({
dsn: 'yourdsn',
integrations: [new Integrations.Dedupe()],
});
Most helpful comment
@ms88privat https://docs.sentry.io/platforms/javascript/#dedupe