Skip to content

Commit

Permalink
fix(spotlight): Don't give up on Spotlight on 3 errors (#3856)
Browse files Browse the repository at this point in the history
Current Spotlight error handling logic gives up sending events to Spotlight after 3 errors. This doesn't make much sense because:

1. Since there is no back off or retry mechanism, even a very brief server hiccup or restart turns off Spotlight reporting
2. Once this shut off kicks in, there is no way to turn it back on except for a server restart

I added a note for future work for retries and some short buffer.
  • Loading branch information
BYK authored Dec 5, 2024
1 parent 31fdcfa commit 5a09770
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions sentry_sdk/spotlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ def __init__(self, url):

def capture_envelope(self, envelope):
# type: (Envelope) -> None
if self.tries > 3:
sentry_logger.warning(
"Too many errors sending to Spotlight, stop sending events there."
)
return
body = io.BytesIO()
envelope.serialize_into(body)
try:
Expand All @@ -60,7 +55,7 @@ def capture_envelope(self, envelope):
)
req.close()
except Exception as e:
self.tries += 1
# TODO: Implement buffering and retrying with exponential backoff
sentry_logger.warning(str(e))


Expand Down

0 comments on commit 5a09770

Please sign in to comment.