getsentry / sentry-laravel

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

[Cron Monitoring] Easy way to setup queue monitoring #718

Open stayallive opened 1 year ago

stayallive commented 1 year ago

We have the $schedule->command(...)->sentryMonitor() to "magically" setup cron monitoring for scheduled commands, how cool would it be if we could have someway to do this but for queues.

Note: This is pseude code and by no means a final draft or how it should or could work

$schedule->sentryWatchQueue('first_queue', 'second_queue')->everyFiveMinutes();

This would setup a scheduled command that fires a job on 2 queues every five minutes which would upsert crons for those queues allowing you to monitor if a queue is still running and processing jobs.

Note: Would probably need to prevent queuing the job multiple times to filling up a queue or should be a throttled queue job so it doesn't DDoS Sentry once it comes back online

h/t @sebastiaankloos

SebastiaanKloos commented 1 year ago

Thanks for tagging @stayallive 👀

cleptric commented 1 year ago

:shipit:

arfar-x commented 4 months ago

There is Horizon for monitoring Laravel's queues. But what it lacks is, it doesn't simulate/reproduce the state of other queues for concurrently running queues. Possible features could be as the following:

Laravel's Horizon is a mature system, so this feature can be integrated with it.