Skip to content

Commit 5a09770

Browse files
authored
fix(spotlight): Don't give up on Spotlight on 3 errors (#3856)
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.
1 parent 31fdcfa commit 5a09770

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sentry_sdk/spotlight.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ def __init__(self, url):
4242

4343
def capture_envelope(self, envelope):
4444
# type: (Envelope) -> None
45-
if self.tries > 3:
46-
sentry_logger.warning(
47-
"Too many errors sending to Spotlight, stop sending events there."
48-
)
49-
return
5045
body = io.BytesIO()
5146
envelope.serialize_into(body)
5247
try:
@@ -60,7 +55,7 @@ def capture_envelope(self, envelope):
6055
)
6156
req.close()
6257
except Exception as e:
63-
self.tries += 1
58+
# TODO: Implement buffering and retrying with exponential backoff
6459
sentry_logger.warning(str(e))
6560

6661

0 commit comments

Comments
 (0)