Sentry-laravel: queue integration

Created on 1 Jun 2016  路  11Comments  路  Source: getsentry/sentry-laravel

Hello,

does it integrate with laravel queues by default?
Looking at the classes I did not spot it

Most helpful comment

I don't think it's really great behavior. If you're sending a lot of data that is hanging user requests you need to ask why that data is being sent. If they're errors then a small delay in the response is acceptable and at least guarantees errors are reported when your workers aren't functioning.

With that said, we have async support in the php SDK, and it just needs a bit of polish to be enabled by default.

All 11 comments

If you want queues you will have to use https://github.com/twineis/raven-php.

This does not integrate with the queues it sends errors as soon as it recieves them in the same request.

Why would you want it to use the queue if I may ask?

So the user doesn't have to wait for application to send error/warning to sentry but is instead loaded 'instantly'.

Okay I understand. I assume then your application sends more things to Sentry then breaking exceptions (as in 500 errors). Might be simpeler to just implement your own queue job to do this.

I personally rather have the error sent instantly in case the queues are also broken.

evryone has it's own preferences I think. I prefer not to 'delay' the user.. because usually exception in the queue can be handled later.
I just asked if this package supported this.. well no then no :)

to add.. on other hand. if there would be queue support. we would not need 3rd party implementations for laravel. less efforts, less forks... everyone wins!

Maybe @dcramer could enlighten us if he thinks this would be in the scope of the package and maybe someone could PR this.

I don't think it's really great behavior. If you're sending a lot of data that is hanging user requests you need to ask why that data is being sent. If they're errors then a small delay in the response is acceptable and at least guarantees errors are reported when your workers aren't functioning.

With that said, we have async support in the php SDK, and it just needs a bit of polish to be enabled by default.

For anyone else looking at this old thread - you can use the failed(\Exception $exception) handler in Laravel to force errors to be sent across.
https://stackoverflow.com/questions/49509750/send-error-report-to-sentry-within-laravel-queue

https://laravel.com/docs/5.6/queues#dealing-with-failed-jobs

@gregrobson, this is not what the issue is about... this issues is asking if events are sent using the queue (so the sending of issues is non-blocking), which for the record is not the case.

Also Exceptions thrown in queues are catched by default if you use the integration as described in the README by adding it to your error handler class.

Adding it to the failed method of you queue job can even result in double reporting (not sure if the error handler is skipped if you implement the failed method).

@stayallive Ah, my fault, didn't read it closely enough.

Odd - My errors are only being reported when I log them using the global Queue::failing() handler (and they only log once). I see you recently released v0.9.0 with channel support: I'll upgrade and double check the behaviour - if it's still causing issues I'll raise an separate ticket.

Thanks for the quick response! 馃憤

Was this page helpful?
0 / 5 - 0 ratings