Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GM's avatar
Level 8

Horizon Metrics empty

Having a few issues getting Horizon to show metrics. The Dashboard correctly shows the queue names under Current Workload, but these never seem to propagate into the Metrics screen. I only ever see "There aren't any jobs." or "There aren't any queues.".

I do however see the Jobs show up in "Recent Jobs" and the failures in "Failed".

In my /config/horizon.php file I have modified the following settings:

 'prefix' => env('HORIZON_PREFIX', 'horizon1:'),
'environments' => [
        'production' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default'],
                'balance' => 'auto',
                'processes' => 10,
                'tries' => 3,
            ],
        ],

        'local' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default','video','gps','log'],
                'balance' => 'auto',
                'processes' => 3,
                'tries' => 3,
            ],
        ],
    ],

I'm not sure that I really need a 'default' queue... I kindof just left that in there.

in my jobs I have for example

$queue="video";
$delay="5",
...
$job = (new ImportUnencrypted($file->getRealPath(), $this->queueRunTime, $this->singlefile))->onQueue($queue)->delay($delay);
...
dispatch($job)

As this is a batch process, I also tried to clear the queues with

$queues = ['gps','log', 'video'];
...
if ($this->isRedis) {
                foreach ($queues as $queue) {
                    $this->info('Clearing queue: ' . $queue);
                    redis::connection()->del('queues:' + $queue);
                }
            }

But that didn't seem to work either. At the moment the only way I seem to be able to do this is to halt the supervisor process and issue a

php artisan cache:clear

Where am I going wrong?

0 likes
2 replies
hromby's avatar

Did you find any solution to this? I am having the same issue on my staging server -- my local environment displays the data correctly.

hromby's avatar

I figured it out actually, and just wanted to leave my solution here if anyone should have the same problem in the future:

Keyword here was that i was on my staging server, where the environment is defined as "staging". There was no staging entry in the environments array in the Horizon configuration. I added a copy of the default config to this array with the key "staging" and restarted Horizon on my staging server, and the metrics started to show :-)

2 likes

Please or to participate in this conversation.