getsentry / sentry-laravel

The official Laravel SDK for Sentry (sentry.io)
https://sentry.io
MIT License
1.26k stars 188 forks source link

Ignore exception "Prevent deadlock SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction" #811

Closed sts-ryan-holton closed 11 months ago

sts-ryan-holton commented 11 months ago

Problem Statement

Hi, I'm using Laravel 10's queue. I'm not using Redis, instead the database connection. Typically, with larger systems like mine I come across a lot of queue related exceptions that aren't really in my control or I'd just like to filter them out. For example, the following kind of exception listed here.

How could I exclude such exception to prevent exhausting my Sentry controller, or, moreover, exclude the exceptions from queues entirely to just report exceptions in my controllers/routes etc

Prevent deadlock SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction - Laravel

Solution Brainstorm

How would I achieve such result

cleptric commented 11 months ago

We offer various filtering options, see https://docs.sentry.io/platforms/php/guides/laravel/configuration/filtering.

before_send might be your best bet, as you want to conditional exclude certain errors.