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

bingo-padlock's avatar

Telescope - Duration not showing on client requests

I have two separate laravel applications. Both are up to date with latest laravel and telescope. When I view the client requests in telescope on one of the applications I see the duration column in the listing page, and when you click to get the details, on that page too. The other application its missing in both places. I checked the database telescope entries on the application it's not showing and the entries do appear to be valid, well formed, and have a duration with a value. I tried copying and pasting a entry from the one that works into the one that doesn't but the same thing. I see all the values besides the duration.

I've thoroughly reviewed the middleware and configurations multiple times but haven't found any reason why the duration field isn't displaying in the one application, or what it IS in the other.

Any suggestions on what to try or check? Thanks!

0 likes
2 replies
LaryAI's avatar
Level 58

It sounds like you've already done a lot of troubleshooting, which is great. Here are a few additional steps you can take to try to resolve the issue with the duration not showing in Laravel Telescope:

  1. Check Telescope Configuration: Ensure that the telescope.php configuration file is correctly set up in both applications. Specifically, check if there are any differences in the watchers array that might affect the recording of request durations.

    // config/telescope.php
    'watchers' => [
        Watchers\RequestWatcher::class => [
            'enabled' => env('TELESCOPE_REQUEST_WATCHER', true),
            'size_limit' => env('TELESCOPE_REQUEST_WATCHER_SIZE_LIMIT', 64),
        ],
        // other watchers...
    ],
    
  2. Middleware: Verify that the TelescopeMiddleware is correctly applied in both applications. This middleware is responsible for collecting request data.

    // app/Http/Kernel.php
    protected $middleware = [
        // other middleware...
        \Laravel\Telescope\Http\Middleware\Authorize::class,
    ];
    
  3. Database Schema: Ensure that the database schema for the telescope_entries table is identical in both applications. Specifically, check that the duration column exists and is of the correct type.

    Schema::create('telescope_entries', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('batch_id');
        $table->string('family_hash')->nullable();
        $table->string('should_display_on_index')->default(true);
        $table->string('type');
        $table->text('content');
        $table->unsignedInteger('duration')->nullable();
        $table->timestamps();
    });
    
  4. Clear Cache: Sometimes, configuration or route caches can cause issues. Clear the caches to ensure that the latest configurations are being used.

    php artisan config:cache
    php artisan route:cache
    php artisan view:cache
    php artisan cache:clear
    
  5. Update Telescope: Ensure that both applications are using the same version of Laravel Telescope. You can update Telescope using Composer.

    composer require laravel/telescope
    
  6. Check Telescope Service Provider: Ensure that the TelescopeServiceProvider is correctly registered in both applications.

    // app/Providers/TelescopeServiceProvider.php
    use Laravel\Telescope\Telescope;
    use Laravel\Telescope\TelescopeApplicationServiceProvider;
    
    class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
    {
        // ...
    }
    
  7. Debugging: Add some debugging statements in the TelescopeServiceProvider to log or dump the request data to ensure that the duration is being captured correctly.

    // app/Providers/TelescopeServiceProvider.php
    use Laravel\Telescope\IncomingEntry;
    
    public function register()
    {
        Telescope::filter(function (IncomingEntry $entry) {
            if ($entry->type === 'request') {
                \Log::info('Request Duration: ' . $entry->content['duration']);
            }
            return true;
        });
    }
    

By following these steps, you should be able to identify and resolve the issue with the duration not showing in Laravel Telescope. If the problem persists, consider comparing the entire Telescope configuration and setup between the two applications to identify any discrepancies.

bingo-padlock's avatar

Thank you AI for suggesting those. I did try all of those suggestions but it did not solve the duration missing issue.

Please or to participate in this conversation.