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

amirsobhan's avatar

Laravel Telescope does not record Redis events with different connection

Hello, I use a telescope for debugging purposes. The cache section that collects Redis events works fine with Laravel build-in features such as sessions and rate limit but when I add a new Redis connection to use another database, I ran into a problem because it does not record the events from that connection. Here is my code:

Environment:

  • OS: Ubuntu 22.04 LTS (WSL 2)
  • PHP version: 8.1.2-1ubuntu2.11
  • Laravel version: 9.52.4
  • Laravel Telescope version: 4.14.0

It's redis section in config/database.php that I defined the new connection

 'redis' => [
        'client' => env('REDIS_CLIENT', 'phpredis'),
        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'serializer' => \Redis::SERIALIZER_IGBINARY,
        ],
        'default' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => 0,
        ],
        'cache' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => 1,
        ],
        'session' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => 2,
        ],
        'auth' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => 3,
        ],
    ],

And when I try to use this like that:

use Illuminate\Support\Facades\Redis;

Redis::connection('auth')
        ->client()
        ->set('foo', 'bar');

It sets the key but the Laravel telescope doesn't record that. Anyone had an idea or suggestion?

0 likes
0 replies

Please or to participate in this conversation.