Skip to content

Commit 504ee28

Browse files
authored
ref(tags): add concurrent_limit to ratelimit (#94831)
We've seen some load increases on the errors cluster that I think might have been partially driven by specific users (those users being proxy users of internal integrations) hitting endpoints that run expensive/long queries on clickhouse We have some rate-limiting in snuba but that is on the project and organization level for the most part. When debugging on sentry it looked like default `concurrent_limit` is 25 ```deprecated rate limit specification {'GET': {<RateLimitCategory.IP: 'ip'>: RateLimit(limit=10, window=1, concurrent_limit=25), <RateLimitCategory.USER: 'user'>: RateLimit(limit=10, window=1, concurrent_limit=25), <RateLimitCategory.ORGANIZATION: 'org'>: RateLimit(limit=40, window=1, concurrent_limit=25)}}``` (from SENTRY-3PFR) For these endpoints we will want lower than 25 per user since the snuba concurrent ratelimiting is lower than 25 for this referrer Adding this to `org` as well since integration tokens that are tied to orgs get org wide limits
1 parent 976c31e commit 504ee28

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/sentry/api/endpoints/group_tagkey_details.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class GroupTagKeyDetailsEndpoint(GroupEndpoint):
3535

3636
rate_limits = {
3737
"GET": {
38-
RateLimitCategory.IP: RateLimit(limit=10, window=1),
39-
RateLimitCategory.USER: RateLimit(limit=10, window=1),
40-
RateLimitCategory.ORGANIZATION: RateLimit(limit=40, window=1),
38+
RateLimitCategory.IP: RateLimit(limit=10, window=1, concurrent_limit=10),
39+
RateLimitCategory.USER: RateLimit(limit=10, window=1, concurrent_limit=10),
40+
RateLimitCategory.ORGANIZATION: RateLimit(limit=40, window=1, concurrent_limit=10),
4141
}
4242
}
4343

src/sentry/api/endpoints/group_tagkey_values.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class GroupTagKeyValuesEndpoint(GroupEndpoint):
3535

3636
rate_limits = {
3737
"GET": {
38-
RateLimitCategory.IP: RateLimit(limit=10, window=1),
39-
RateLimitCategory.USER: RateLimit(limit=10, window=1),
40-
RateLimitCategory.ORGANIZATION: RateLimit(limit=40, window=1),
38+
RateLimitCategory.IP: RateLimit(limit=10, window=1, concurrent_limit=10),
39+
RateLimitCategory.USER: RateLimit(limit=10, window=1, concurrent_limit=10),
40+
RateLimitCategory.ORGANIZATION: RateLimit(limit=40, window=1, concurrent_limit=10),
4141
}
4242
}
4343

0 commit comments

Comments
 (0)