Skip to content

Commit

Permalink
use fingerprint on scope
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshFerge committed Feb 28, 2025
1 parent 4f4defa commit aa95e03
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sentry/api/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
def custom_exception_handler(exc, context):
if isinstance(exc, RateLimitExceeded):
# capture the rate limited exception so we can see it in Sentry
sentry_sdk.capture_exception(
exc,
fingerprint=["snuba-api-rate-limit-exceeded"],
level="warning",
)
with sentry_sdk.new_scope() as scope:
scope.fingerprint = ["snuba-api-rate-limit-exceeded"]
sentry_sdk.capture_exception(
exc,
level="warning",
)
# let the client know that they've been rate limited with details
exc = Throttled(
detail="Rate limit exceeded. Please try your query with a smaller date range or fewer projects."
Expand Down

0 comments on commit aa95e03

Please sign in to comment.