-
Notifications
You must be signed in to change notification settings - Fork 599
Description
I am using RQ as my job queue. I have some use cases where retries and optimistic locking are used to smooth out contentious writes to the database and out of order execution.
This results in a lot of false positives in Sentry. These issues fix themselves after retry so I do not want them reported to sentry until all the retries are exhausted. Currently there isn't a way to suppress the exception due to the way the sentry integration is monkey patching RQ. You need to inspect the RQ job instance status in order to determine whether or not retries have been exhausted.
I am happy to contribute the change if it has a chance at being accepted.
I see three possible solutions:
- Add a settings to the RQ integration along the lines of failed_jobs_only. This setting would default to false to maintain backwards compatibility.
- Provide a hook mechanism that passes the job in and let users customize whether or not to capture the event
- Stuff some job information like the status into the hint so it can be inspected and filtered via the standard before_send hook.
IMO 1 or 3 is the way to go. 1 is the simplest and 3 is more flexible. I am not sure if stuffing random data into hint like this is desirable from Sentry's standpoint.