Home / Snippets / How to Record Laravel Horizon Metrics (Snapshot)
How to Record Laravel Horizon Metrics (Snapshot) cover

How to Record Laravel Horizon Metrics (Snapshot)

713

3 years ago

0 comments

Laravel Horizon provides a beautiful dashboard and code-driven configuration for your Laravel powered Redis queues.

In the Horizon dashboard, there's a metrics dashboard and there you can see the graph of the ongoing "Jobs" and "Queues". In order to record/capture the ongoing queues that happen within your Laravel application, you can make use of the snapshot command.

To do that you have to run the "horizon:snapshot" command like below inside your console kernel class.
/**
 * Define the application's command schedule.
 *
 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $schedule->command('horizon:snapshot')->everyFiveMinutes();
}

Related Resource
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this