Skip to content
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

Prevent duplicate issues from same user #530

Closed
dcramer opened this issue Mar 15, 2016 · 9 comments
Closed

Prevent duplicate issues from same user #530

dcramer opened this issue Mar 15, 2016 · 9 comments

Comments

@dcramer
Copy link
Member

dcramer commented Mar 15, 2016

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:

  • max number of issues a user can send in a time window
  • (possibly) a stack of the recorded issues to prevent sending them again
@genintho
Copy link

So agreeing !!1

10 hours after having deployed
screen shot 2016-07-26 at 5 01 51 pm

@oliviertassinari
Copy link
Contributor

oliviertassinari commented Sep 20, 2016

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

This was referenced Nov 14, 2016
@slorber
Copy link

slorber commented Jan 23, 2017

Thanks @oliviertassinari that seems good for filtering React useless and repetitive errors, will use something similar!

@oliviertassinari
Copy link
Contributor

@slorber It's production tested at @doctolib. It might worth extracting that into a small library.

@MaxBittker
Copy link
Contributor

#861

@ms88privat
Copy link

@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

@kamilogorek
Copy link
Contributor

kamilogorek commented Aug 8, 2019

@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()],
});

@YutaMoriJP
Copy link

Is #530 (comment) still worth implementing with Dedupe support?

@kamilogorek
Copy link
Contributor

@YutaMoriJP it's built-in into the SDK - https://docs.sentry.io/platforms/javascript/configuration/options/#sample-rate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants