-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
can set maxEventsPerPage config option #767
Conversation
IMHO this implementation is too naive to be useful. Usually you'd want to throttle only one kind of an error, and not all of them regardless of their type. |
@Sija I don't necessarily disagree, might take another look at this tomorrow. interested in @benvinegar 's opinion here |
@Sija – the problem is that determining what is the "same" error is non-trivial. We could probably make a "best guess" effort from the client, but there's a risk that it could fail on seemingly similar errors. That being said, we're going to explore such a solution, see what it looks like, and revisit this. |
@benvinegar I agree, good starting point could be simple heuristics based on |
Now that #861 is enabled by default for everyone, I think we can come back to this. It's simple to implement, and there's an argument for having it in some situations (e.g. when pages are open in a tab for 24 hours straight). One last ask: we should reset the captured error count whenever there's a URL change (e.g. via |
Heard from a user yesterday for whom they could benefit from this. |
This would stop the bleeding. For my use-case, the platform is a site builder and sometimes raven-js picks up a user's 3rd party failures. I'm brought to this ticket because the latest event resulted in ~40k events, which hits the rate limit, stats look like the platform is down, and legitimate events are dropped. This would allow us to set an upper-bound on the pathological scenarios. |
I don't see any particular reason why we'd not want to include this config option (with it being set to |
We should move forward; it keeps coming up. I'd personally prefer if this were |
6ac383a
to
4eb7a2c
Compare
4eb7a2c
to
9ddadf0
Compare
@benvinegar updated the code, docs and TS definitions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Biggest issue is that this will only work if breadcrumbs is enabled.
Unfortunately event/DOM instrumentation is tied really closely to breadcrumbs. We need to separate these two concepts.
Sorry! This ended up being tougher than I hinted at 😅
@@ -875,6 +876,9 @@ Raven.prototype = { | |||
var parsedTo = parseUrl(to); | |||
var parsedFrom = parseUrl(from); | |||
|
|||
// refresh max events count | |||
this._sentEvents = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If breadcrumbs are disabled, this won't get called / won't reset.
@@ -1255,6 +1259,9 @@ Raven.prototype = { | |||
return function(/* state, title, url */) { | |||
var url = arguments.length > 2 ? arguments[2] : undefined; | |||
|
|||
// refresh max events count | |||
self._sentEvents = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Ah, right. I didn't realise that. Also we won't have location changes when we'll unify node/browser, which mean that we'd have to diverge an API once again in this case... I'm not sure about integrating that perPage in this case. |
Truly unifying these APIs is probably impossible. A common core is more realistic. We'll probably need to sit down and document what features are in both and see how we can get there. Edit: I did think for a bit about how we could make this more generic, e.g. so we could use it server-side as well, but nothing comes to mind. |
Using Sentry.io, the overage fees are priced per event, making this feature is essential. Especially if the consuming platform limits the ability to use whitelists, blacklists, and filters to cull all abusive scenarios. |
Linked this PR discussion to proper docs |
this needs to be noted in the docs but I don't want to have those pulled out before this ships.
I reset _sentErrors in _captureUrlChange and the pushState wrapper, which is a little bit janky but I believe it covers a wider range of applications without doing much harm. (although I could be misunderstanding the behavior of these apis)