Skip to content

Streamline integration of SQS Batch Processing with Sentry #293

Closed
@charlax

Description

@charlax

Is your feature request related to a problem? Please describe.

The current behavior reraises exception as SQSBatchProcessingError, which hides the original exception and prevents it from showing up correctly in Sentry:

SQSBatchProcessingError
Not all records processed succesfully. 1 individual errors logged separately below.

Traceback (most recent call last):
  File "/var/task/urllib3/connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/var/task/urllib3/connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "/var/task/sentry_sdk/integrations/stdlib.py", line 102, in getresponse
    rv = real_getresponse(self, *args, **kwargs)
  Fi...

Describe the solution you'd like

The best solution would be to be compatible by default with Sentry if it's there (I presume this is one of the most used exception reporting solutions for Python).

Another solution would be to provide a hook into the exception handler, to give us the opportunity to call Sentry.

Describe alternatives you've considered

I looked into subclassing PartialSQSProcessor and overriding _process_record, which is what I might do if you don't think that's worth looking into.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions