-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat(transports): Category-based Rate Limiting #354
Conversation
It has not given us much value. Instead of adding 'nolint' lines for the few cases where we do need long lines, better not have this linter and keep the code base free of linter pragmas.
Fixing the linter failure by disabling the |
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.
Table tests 🎉
I only have small formatting concerns and some questions (mostly questions 😄), this looks really good. Will approve after comments get addressed.
If the same transport is shared across goroutines, we need to synchronize reads and writes to the rate limit map. The transport is shared and used concurrently when we clone and use hubs from multiple goroutines. Note that previously there was a data race updating the `disabledUntil` field.
io.ReadAll was added in Go 1.16, but we support older versions too. We have to use the one from ioutil for compatibility.
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.
After sleeping on it, I think the current file structure makes the most sense.
This adds support for parsing the
X-Sentry-Rate-Limits
and rate limiting errors and transactions independently.