Giter Club home page Giter Club logo

pulse's Introduction

Laravel Pulse Logo

Build Status Total Downloads Latest Stable Version License

Introduction

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

Official Documentation

Documentation for Pulse can be found on the Laravel website.

Contributing

Thank you for considering contributing to Pulse! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

Laravel Pulse is open-sourced software licensed under the MIT license.

pulse's People

Contributors

ahinkle avatar andrey-helldar avatar ashleyshenton avatar austinw avatar crynobone avatar danwall avatar dependabot[bot] avatar devajmeireles avatar driesvints avatar gcazin avatar hulkur avatar jbrooksuk avatar jessarcher avatar jubeki avatar justinelst avatar kieranbarlow avatar kohenkatz avatar matheus-carvalho avatar medilies avatar niller2005 avatar nunomaduro avatar paulo-hortelan avatar perryvandermeer avatar pierrepavlov avatar simoebenhida avatar srwiez avatar taylorotwell avatar timacdonald avatar toitzi avatar xico2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulse's Issues

Undefined array key "lazy" when visiting the pulse route

Pulse Version

1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.2.4

Database Driver & Version

No response

Description

I installed pulse into an existing project and on visiting the /pulse route locally and in production I get this error:

Illuminate\View\ViewException
Undefined array key "lazy" (View: /home/forge/paydel.app/vendor/laravel/pulse/resources/views/dashboard.blade.php)

Telescope identifies the error as originating from:

Location : /home/forge/paydel.app/vendor/livewire/livewire/src/Features/SupportLazyLoading/SupportLazyLoading.php:105

My Livewire version is 3.0.0
I upgraded from version 2 before installing pulse.

Steps To Reproduce

Visit the /pulse route.

Allow for name variations on users

Pulse Version

v1.0.0-beta2

Laravel Version

10.33.0

PHP Version

8.2.12

Description

Updating the user model to use a first_name and last_name results in an error exception for the missing name field

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'field list'

Steps To Reproduce

Remove the name field from the User model

Avatar URL gets overridden regardless of custom user resolution

Pulse Version

1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.2.12

Database Driver & Version

MySQL 8.0.32

Description

Even if I define an 'avatar' array key as described in the docs

Pulse::users(function ($ids) {
    return User::findMany($ids)->map(fn ($user) => [
        'id' => $user->id,
        'name' => $user->name,
        'extra' => $user->email,
        'avatar' => $user->avatar_url,
    ]);
});

it will get overriden by the Collection mapping in src/Livewire/Usage.php.

'avatar' => $user['avatar'] ?? (($user['email'] ?? false)
? sprintf('https://gravatar.com/avatar/%s?d=mp', hash('sha256', trim(strtolower($user['email']))))
: null),

Also, the gravatar URL includes an 'email' array key that is not stated in the docs, I would suggest to either replace that with 'extra' or add email to the example.

Steps To Reproduce

  1. Install Laravel Pulse
  2. Insert
    Pulse::users(function ($ids) {
    return User::findMany($ids)->map(fn ($user) => [
        'id' => $user->id,
        'name' => $user->name,
        'extra' => $user->email,
        'avatar' => $user->avatar_url,
    ]);
    });
    
    into your AuthServiceProvider.php's boot() function
  3. Open Laravel Pulse

Cannot use command "php artisan migrate"

Pulse Version

1.0.0

Laravel Version

10.34.2

PHP Version

8.3

Description

I can't use the command 'php artisan migrate' because I encounter this error when running the command.
Database: PostgreSQL 16

SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")"
LINE 1: ...(16) not null generated always as (unhex(md5(key))), "valu...
^ (Connection: pgsql, SQL: create table "pulse_values" ("timestamp" integer not null, "type" varchar(255) not null, "key" text not null, "key_hash" char(16) not null generated always as (unhex(md5(key))), "value" text not null))

Screenshot 2566-12-02 at 10 55 08

Steps To Reproduce

[SOLVED] Could not find Livewire component in DOM tree

Pulse Version

v1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.3.0

Description

For some reason, I'm getting "Could not find Livewire component in DOM tree" in my Laravel project with Pulse freshly installed into it.

image

The /pulse endpoint somewhat loads with the informations, but the interface itself is unresponsive (selectors, etc).

Where should I even start to debug this?

Steps To Reproduce

Custom viewPulse Gate not working

Pulse Version

1.0.0-beta1

Laravel Version

10.34.2

PHP Version

8.2.12

Description

When I define the following Gate in the boot method of app\Providers\AuthServiceProvider.php

Gate::define('viewPulse', function (User $user) {
    return true;
});

I still get a 403 error. This is ofcourse happening in production.

Steps To Reproduce

Set up a new laravel app (using sail).

Change the composer minimum stability

composer require laravel/pulse

Migrate db

Change .env to production

Clear cache

Define Gate as described in my issue above

Browse to /pulse

Gate not working

Pulse Version

dev-card-customisation

Laravel Version

10.8

PHP Version

8.2.5

Database Driver & Version

No response

Description

I've defined the gate exactly as per the docs. However it doesn't seem to be used.

If I change my environment to production, it's always 403.

It's odd because I have Nova running with a gate as well and that works but the Gate defined in AuthServiceProvider never seems to be called.

I tried dd'ing the value of static::$authUsing in Pulse.php and it is always null.

Steps To Reproduce

Install pulse, setup as per docs.

Does not allow for User Models with non-standard fields

Pulse Version

v1.0.0-beta2

Laravel Version

10.28.0

PHP Version

8.2.9

Description

Hello first of all, cool project!

Installed it on a project I'm working on but I'm getting an error when accessing the dashboard.
The error seem to stem from Usage.php using the pulse facade calling line 333 or 335 (depending on user model path).

} elseif (class_exists(\App\Models\User::class)) {
    return \App\Models\User::whereKey($ids)->get(['id', 'name', 'email']);
} elseif (class_exists(\App\User::class)) {
    return \App\User::whereKey($ids)->get(['id', 'name', 'email']);
}

It's trying to get a few attributes of the users it's fetching, now the issue is that those attributes doesn't always exists, for example in my project we don't use email at all, but instead a different db field name, so the attribute name is different and email doesn't exist.

Maybe an easy way to fix it would be to allow an array of fields in the config, so users could just define some fields? Or maybe some magic that tries to figure out what correct fields, anyways it's bugging out as of now.

Steps To Reproduce

Install pulse on a Laravel project where the user model doesn't for example have the email field or any of the other wanted fields in the code. Then access the dashboard and the bug will appear.

Option to disable (or change fields) Application Usage

I have non standard Users table, which does not have name and email fields, and because of this I'm unable to open the page at all. Didn't find any option in the config file to change/disable it.

Would prefer to see option to change the fields it uses, or disable the option in general.

Pulse keeps loading livewire component, does not render

Pulse Version

1.0.0

Laravel Version

10.4.1

PHP Version

8.3

Description

Screenshot 2023-12-01 at 8 59 39 PM

The database has pulse data and I can see recorded activity there as well but the /pulse route is not displaying the data. Same on local machine using Laravel Herd and also on Laravel Forge online

Steps To Reproduce

composer require laravel/pulse
php artisan migrate

The /pulse route shows the pulse menu but no data

PHP crashes with SIGSEGV

Pulse Version

1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.2.8

Database Driver & Version

MariaDB 10.11 under Docker on arm64 (Mac)

Description

My app is running as a docker-compose project. I have an "app" container based on php:8.2-fpm-bullseye and it sits behind a reverse proxy container based on nginx:alpine.

Shortly after running composer require laravel/pulse and browsing to the /pulse route, PHP processes under php-fpm start crashing:

2023-12-04 13:31:58 [04-Dec-2023 02:31:58] WARNING: [pool www] child 1653 exited on signal 11 (SIGSEGV) after 23.091227 seconds from start

Eventually all children die, and the app is inaccessible (nginx throws 502 instantly on all requests).

php artisan about

  Environment ...........................................................................................  
  Application Name .................................................................................. BPM  
  Laravel Version ............................................................................... 10.34.2  
  PHP Version ..................................................................................... 8.2.8  
  Composer Version ................................................................................ 2.5.8  
  Environment ..................................................................................... local  
  Debug Mode .................................................................................... ENABLED  
  URL .................................................................................... localhost:9002  
  Maintenance Mode .................................................................................. OFF  

  Cache .................................................................................................  
  Config ..................................................................................... NOT CACHED  
  Events ..................................................................................... NOT CACHED  
  Routes ..................................................................................... NOT CACHED  
  Views .......................................................................................... CACHED  

  Drivers ...............................................................................................  
  Broadcasting ................................................................................... pusher  
  Cache ........................................................................................... redis  
  Database ........................................................................................ mysql  
  Logs ................................................................................... stack / single  
  Mail ............................................................................................. smtp  
  Queue ........................................................................................... redis  
  Session .......................................................................................... file  

  Livewire ..............................................................................................  
  Livewire ....................................................................................... v3.2.3  

composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^8.1",
        "beyondcode/laravel-websockets": "^1.14",
        "bpm/dashboard": "@dev",
        "ebess/advanced-nova-media-library": "^4.1",
        "guzzlehttp/guzzle": "^7.2",
        "kiritokatklian/nova-permission": "^4.0",
        "laravel/framework": "^10.13",
        "laravel/nova": "4.23.0",
        "laravel/passport": "^11.5",
        "laravel/pulse": "^1.0@beta",
        "laravel/tinker": "^2.8",
        "laravel/ui": "^4.2",
        "league/flysystem-aws-s3-v3": "^3.0",
        "php-ffmpeg/php-ffmpeg": "^1.1",
        "phpoffice/phpspreadsheet": "^1.15",
        "predis/predis": "^1.1",
        "pusher/pusher-php-server": "^7.2",
        "simplesoftwareio/simple-qrcode": "~4",
        "spatie/laravel-medialibrary": "^10.7",
        "spatie/laravel-permission": "^5.8"
    },
    "require-dev": {
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.0",
        "fakerphp/faker": "^1.9.1",
        "spatie/laravel-ignition": "^2.0"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://nova.laravel.com"
        },
        {
            "type": "path",
            "url": "./nova-components/Dashboard"
        }
    ],
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "beta",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ]
    }
}

I'm not sure how to go about debugging this.

Steps To Reproduce

I haven't tried reproducing in an open codebase yet, but happy to attempt it.

Migration error

Pulse Version

v1.0.0-beta4

Laravel Version

10.35.0

PHP Version

8.3.0

Database Driver & Version

No response

Description

INFO Running migrations.

2023_06_07_000001_create_pulse_tables ................................................................................................... 1ms FAIL

Error

Call to a member function getDriverName() on string

at vendor/laravel/pulse/database/migrations/2023_06_07_000001_create_pulse_tables.php:32
28▕ $table->id();
29▕ $table->unsignedInteger('timestamp');
30▕ $table->string('type');
31▕ $table->text('key');
➜ 32▕ match ($driver = $connection->getDriverName()) {
33▕ 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(key))'),
34▕ 'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'),
35▕ default => throw new RuntimeException("Unsupported database driver [{$driver}]."),
36▕ };

Steps To Reproduce

run php artisan migrate

Migration failed

Pulse Version

1.0@beta

Laravel Version

10.10

PHP Version

8.1

Description

Hello,

I am not able to implement Pulse in my Laravel application. When i installed using composer it's intalled but not migrating their tables for database. I am facing below issue when i run php artisan migrate .

SQLSTATE[HY000]: General error: 1478 Table storage engine 'MyISAM' does not support the create option 'Index on virtual generated column' (Connection: mysql, SQL: alter table pulse_values add unique pulse_values_type_key_hash_unique(type, key_hash))

at vendor\laravel\framework\src\Illuminate\Database\Connection.php:822
818▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
819▕ );
820▕ }
821▕
➜ 822▕ throw new QueryException(
823▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
824▕ );
825▕ }
826▕ }

1 vendor\laravel\framework\src\Illuminate\Database\Connection.php:580
PDOException::("SQLSTATE[HY000]: General error: 1478 Table storage engine 'MyISAM' does not support the create option 'Index on virtual generated column'")

2 vendor\laravel\framework\src\Illuminate\Database\Connection.php:580
PDOStatement::execute()

Steps To Reproduce

Hello,

I am not able to implement Pulse in my Laravel application. When i installed using composer it's intalled but not migrating their tables for database. I am facing below issue when i run php artisan migrate .

SQLSTATE[HY000]: General error: 1478 Table storage engine 'MyISAM' does not support the create option 'Index on virtual generated column' (Connection: mysql, SQL: alter table pulse_values add unique pulse_values_type_key_hash_unique(type, key_hash))

at vendor\laravel\framework\src\Illuminate\Database\Connection.php:822
818▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
819▕ );
820▕ }
821▕
➜ 822▕ throw new QueryException(
823▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
824▕ );
825▕ }
826▕ }

1 vendor\laravel\framework\src\Illuminate\Database\Connection.php:580
PDOException::("SQLSTATE[HY000]: General error: 1478 Table storage engine 'MyISAM' does not support the create option 'Index on virtual generated column'")

2 vendor\laravel\framework\src\Illuminate\Database\Connection.php:580
PDOStatement::execute()

Pulse 1.0.0-beta3 version is not working due to appending APP_URL.

Pulse Version

1.0.0-beta3

Laravel Version

10.34.2

PHP Version

8.2.13

Database Driver & Version

Mysql

Description

I installed Pulse 1.0.0-beta3 version today which not loading Pulse dashboard due to the appending APP_URL., if i commented the APP_URL from .env file. Its working fine. i tried production server too and its same.

Please check the screenshot.
pulse screenshot

Steps To Reproduce

Install the Pulse 1.0.0-beta3 version into existing Laravel app.

livewire.js returns 404 in network logs

Pulse Version

^1.0@beta

Laravel Version

10.34.2

PHP Version

8.1.26

Database Driver & Version

mysql Ver 14.14 Distrib 5.7.35-38, for debian-linux-gnu (x86_64) using 7.0

Description

when going to /pulse the page is loaded but no data is displayed and the elements aren't properly created.
Network logs show: 404 not found to the GET request to /livewire/livewire.js?id=123

this is a fresh install for pulse on an existing system. I have not used livewire before and wasn't aware it is in the system as well.

image
pulse

Steps To Reproduce

try change `PULSE_INGEST_DRIVER`

Pulse Version

1.0@beta

Laravel Version

10.10

PHP Version

8.2.8

Database Driver & Version

MySql 8 on linux azure cloud

Description

changePULSE_INGEST_DRIVER, problem is you limit between storage and redis, me i want to use in: azure_redis

    protected function registerIngest(): void
    {
        $this->app->bind(Ingest::class, fn (Application $app) => match ($app->make('config')->get('pulse.ingest.driver')) {
            'storage' => $app->make(StorageIngest::class),
            'redis' => $app->make(RedisIngest::class),
            default => throw new RuntimeException("Unknown ingest driver [{$app->make('config')->get('pulse.ingest.driver')}]."),
        });
    }

you can set defult as RedisIngest

Steps To Reproduce

non

PSQL Migrate Error (Sail)

Pulse Version

1.0.0

Laravel Version

10.33.0

PHP Version

8.3

Database Driver & Version

Laravel Sail with PostgreSQL

Description

> sail php artisan migrate
 
    INFO  Running migrations.  

  2014_10_12_000000_create_users_table ................................................................................................... 14ms DONE
  2014_10_12_100000_create_password_reset_tokens_table .................................................................................... 4ms DONE
  2019_08_19_000000_create_failed_jobs_table .............................................................................................. 7ms DONE
  2019_12_14_000001_create_personal_access_tokens_table ................................................................................... 5ms DONE
  2023_06_07_000001_create_pulse_tables ................................................................................................... 3ms FAIL

   Illuminate\Database\QueryException 

  SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near ")"
LINE 1: ...(16) not null generated always as (unhex(md5(`key`))), "valu...
                                                             ^ (Connection: pgsql, SQL: create table "pulse_values" ("timestamp" integer not null, "type" varchar(255) not null, "key" text not null, "key_hash" char(16) not null generated always as (unhex(md5(`key`))), "value" text not null))

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:822
    818▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    819▕                 );
    820▕             }
    821▕ 
  ➜ 822▕             throw new QueryException(
    823▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    824▕             );
    825▕         }
    826▕     }

      +35 vendor frames 

  36  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Having multiple Authenticatable models is incorrectly tracked

Pulse Version

v1.0.0-beta2

Laravel Version

10.26.2

PHP Version

8.2.13

Database Driver & Version

No response

Description

User requests are logged with only the ID value in the key-field, however it is possible to have multiple Authenticatable models in Laravel.

The default behavior for Pulse seems to be to log all Authenticated requests, also for other Authenticatable models, but not differentiate the model type.

This leads to a bug where request count are aggregated towards the User model with the ID even if another model is making the authenticated request.

Steps To Reproduce

Install Laravel Pulse on a project with a custom Authenticatable model that can login for instance using Laravel\Sanctum\HasApiTokens

Crash in `FETCH_ASSOC` mode

Pulse Version

1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.1.26

Database Driver & Version

MySQL 8.0.30

Description

Pulse fails to work in FETCH_ASSOC mode (example: Livewire\Cache.php:44).

Steps To Reproduce

Enable FETCH_ASSOC mode:

<?php

namespace App\Listeners;

use Illuminate\Database\Events\StatementPrepared;

class StatementPreparedListener
{
    /**
     * Handle the event.
     */
    public function handle(StatementPrepared $event): void
    {
        $event->statement->setFetchMode(\PDO::FETCH_ASSOC);
    }
}

livewire.js gives 404 in production

Pulse Version

v1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.2.10

Description

In production, the asset /livewire/livewire.js?id=eaa5c323 in the Network tab shows up as 404 Not Found. If I paste the full URL (including the domain name) to the asset in the browser, it does load. This does not happen locally.

Because of this, the dashboard only shows the skeleton loading state.

Steps To Reproduce

Deploy to production I guess 😅

404 /pulse

Pulse Version

1.0@beta-2

Laravel Version

10.34.2

PHP Version

8,2.12

Database Driver & Version

Mariadb

Description

I just installed Pulse, I think I followed all the instructions

  • composer require laravel/pulse
  • set up db and set connection in .env
  • php artisan migrate

/pulse exists in my Routes when I run Route:list

I have cleared the route cache.

I get a 404 when I visit /pulse on my server.

I have tried changing the path in the config file to no avail.

Is there a simple solution, have I missed a step?

Steps To Reproduce

All I did was

  • composer require laravel/pulse
  • set up db and set connection in .env
  • php artisan migrate

PlanetScale deploy requests fail due to missing unique keys

Pulse Version

1.0@beta

Laravel Version

10.10

PHP Version

8.3

Database Driver & Version

No response

Description

Using PlanetScale, I was unable to apply migrations to the production branch due to missing unique keys. Was able workaround this by adding a $table->bigIncrements('id') to each pulse table definition, though I'm not sure if that's intended in the case these are meant to be key-less tables or identified by the various indexes on each table.

I'm fairly new to Laravel, so I'm not too sure if this is really a pressing issue. Applying the keys manually seems to fix the issue.

image

Steps To Reproduce

  • Create new Laravel application use the mysql connector
  • Connect to PlanetScale, create a dev branch off main
  • Apply migrations locally
  • Create a deploy request to merge dev changes into main

ArgumentCountError

Pulse Version

v1.0.0-beta3

Laravel Version

10.34.2

PHP Version

8.2.10

Database Driver & Version

Mysql 8.0.27

Description

Hi!

I have this error

ArgumentCountError
Too few arguments to function with(), 0 passed in PATH/views/b8781141701c873b2952e3dfa136fe32.php on line 38 and at least 1 expected
Coming from the request to : https://MYAPP/livewire/update

This error disappears when i'm removing
@scroll.debounce.5ms="scroll"
From vendor/laravel/pulse/resources/views/components/scroll.blade.php

Do you have any idea of why? And how this is important? I mean, it seems to impact the scroll but can't really tell more.

I'm not really familiar with Livewire, so that's the best of help I could provide.

Thank's in advance!

Steps To Reproduce

Not sure how you could replicate as this is a project I cant share, and I didn't try on fresh install.

Name attribute on User model

Thanks for this amazing package!

When trying the beta I noticed that the name attribute that I have set on the user model doesn't work:

public function getNameAttribute()
{
  return $this->first_name.' '.$this->last_name;
}

I read that it's possible to customize the user resolution and display by invoking the Pulse::users method in the AppServiceProvider, but it might be nice if it uses the attribute if it's defined, if possible (not sure).

Target class [web] does not exist.

Pulse Version

^1.0@beta

Laravel Version

10.34.2

PHP Version

8.2.13

Database Driver & Version

MySQL 8.0.35

Description

After install, I get an error due the non existing middleware web.

Screenshot from 2023-12-05 12-25-55

I have removed all middlewares from config/pulse.php:

    /*
    |--------------------------------------------------------------------------
    | Pulse Route Middleware
    |--------------------------------------------------------------------------
    |
    | These middleware will be assigned to every Pulse route, giving you the
    | chance to add your own middleware to this list or change any of the
    | existing middleware. Of course, reasonable defaults are provided.
    |
    */

    'middleware' => [
    ],

But web middleware is set as fixed on code:

protected function registerRoutes(): void
{
$this->callAfterResolving('router', function (Router $router, Application $app) {
$router->group([
'domain' => $app->make('config')->get('pulse.domain', null),
'prefix' => $app->make('config')->get('pulse.path'),
'middleware' => $app->make('config')->get('pulse.middleware', 'web'),
], function (Router $router) {
$router->get('/', function (Pulse $pulse, ViewFactory $view) {
return $view->make('pulse::dashboard');
})->name('pulse');
});
});
}

Steps To Reproduce

  1. Create a Laravel project and remove web middleware.
  2. Install Pulse.

Localization support

Does the project plan to support interface localization?

It would be great to be able to localize the interface into different languages.

Throwing SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list'

Pulse Version

v1.0.0-beta5

Laravel Version

10.35.0

PHP Version

8.2.12

Database Driver & Version

8.0.35-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

Description

I am converting a core php application to Laravel, so, I need to use the current database wchich I cant change.

In my users table primery key is UserID,
In my User model public $primaryKey = "UserID"

I am getting above given error

Steps To Reproduce

just rename primery key of users table to UserID,
add public $primaryKey = "UserID"; to User model

Can we get the guard name in Pulse::users() ?

In a bunch of apps I have two distinct sections (public and admin) with totally different user classes (users and admins) but all we have in Pulse::users() as id's , but those are not enough to distinguish one from another, as both tables will have a user # 1.

Pulse dashboard doesn't work when the Users model doesn't have a name column

Pulse Version

1.0.0

Laravel Version

10.2.9

PHP Version

8.2.0

Database Driver & Version

No response

Description

I get the following error if the name field doesn't exist in the users table:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'field list'

Can't find any way to solve it myself other than manually creating the column (which isn't ideal).

I'm aware that removing the name column is typically uncommon but I don't think its uncommon enough for it to to be dismissed.

Steps To Reproduce

Remove the name column from the users table.

Error on migration on sqlite

Pulse Version

1.0.0

Laravel Version

10.4.2

PHP Version

8.2

Description

On first migration error:

SQLSTATE[HY000]: General error: 1 no such function: md5 (Connection: sqlite, SQL: create table "pulse_values" ("timestamp" integer not null, "type" varchar not null, "key" text not null, "key_hash" varchar as (unhex(md5(key))), "value" text not null))

Steps To Reproduce

I have tried to install it on existing app, and when step to migrate db came, i got that error.

XRANGE is not supported Redis command

Pulse Version

1.0

Laravel Version

10.34

PHP Version

8.2

Description

When running:

php artisan pulse:work

Command 'XRANGE' is not a registered Redis command. I am using the latest Redis.

Steps To Reproduce

php artisan pulse:work

Add Prometheus endpoints to retrieve data

Hi,

This looks like a really useful project, but I'm already doing all of my monitoring with Grafana, and I'd really like to keep it that way instead of having multiple dashboards spread across different tools, and I'm sure I'm not the only one.

Do you think it would be a good idea to add some configurable Prometheus/VictoriaMetrics endpoints that could be used to pull all that useful data into Grafana ?

Pulse Redis adapter fails when using cachewerk/relay

Pulse Version

1.0.0-beta

Laravel Version

10.34.2

PHP Version

8.2.13

Description

The return values for the Redis client are strict, we're getting the following exception: https://flareapp.io/share/17xK3pbP

Laravel\Pulse\Support\RedisAdapter::client(): Return value must be of type Redis|Predis\Client|Predis\Pipeline\Pipeline, Relay\Relay returned

Relay is a Redis client that is a drop-in replacement for phpredis.

Steps To Reproduce

Customising `Pulse::users` results in `Undefined array key "email"`

Pulse Version

v1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.2.13

Description

When customising the users' attributes in the pulse dashboard using the example shown in the docs, you receive an undefined array key "email" exception.

https://laravel.com/docs/10.x/pulse#application-usage-card

image

I looked into this and it's due to how the avatar_url is resolved.

'avatar' => $user['avatar'] ?? ($user['email'] ?? false)
                                ? sprintf('https://gravatar.com/avatar/%s?d=mp', hash('sha256', trim(strtolower($user['email']))))
                                : null,

In this scenario, the null coalescing operator resolves the first line only. So even if $user['avatar'] exists and is a valid string, it falls into the first part of the ternary sprintf('https://gravatar.com/avatar/%s?d=mp', hash('sha256', trim(strtolower($user['email'])))).

The simplest solution here is to wrap the intended ternary in parentheses so it is resolved independently. Then if $user['avatar'] is set, it will use it.

Steps To Reproduce

I use Jetstream and wanted to customise the users to use the profile_photo_url that comes out of the box with it. So to replicate this issue, create a new Laravel project with the Jetstream stack (I am using Inertia with Vue). Then pull in laravel/pulse and add the following to the AppServiceProvider::boot method.

Pulse::users(function ($ids) {
    return User::findMany($ids)->map(fn ($user) => [
        'id' => $user->id,
        'name' => $user->name,
        'extra' => $user->email,
        'avatar' => $user->profile_photo_url,
    ]);
});

Migration are mysql specific, fails on other databases

Pulse Version

1.0.0 beta

Laravel Version

10.34.2

PHP Version

8.3.0

Description

Migration throws sql error when using postgresql 15

Steps To Reproduce

run php artisan migrate

   INFO  Running migrations.  

  2023_06_07_000001_create_pulse_tables ................................................................................................... 4ms FAIL

   Illuminate\Database\QueryException 

  SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near ")"
LINE 1: ...(16) not null generated always as (unhex(md5(`key`))), "valu...
                                                             ^ (Connection: pgsql, SQL: create table "pulse_values" ("timestamp" integer not null, "type" varchar(255) not null, "key" text not null, "key_hash" char(16) not null generated always as (unhex(md5(`key`))), "value" text not null))

Using custom db connection - with missing table

Pulse Version

1.0.0

Laravel Version

10.34.2

PHP Version

8.3

Database Driver & Version

MySQL 8.0.33 for macOS 14.3 on arm64 (DBngin)

Description

When you use a custom database connection for pulse, and run the migrations without the database already existing, an exception will be thrown. While this is not wrong, usually when you run database migrations and the database does not exist, laravel will print it to the console and ask you if you want to create the non-existent database (here). The problem here seems to be the following:

When running migrations, laravel will run the prepareDatabase() function at the beginning see here. At the point of laravel doing this, the migrations are not yet loaded / included, so it will always check against your defualt database connection. After that it will evaluate the migration path, include them and migrate. Inside the runMigration function the database connection get's evaluated via the getConnection method of the migration itself (here). This is where the default migration of pulse will return the pulse connection. Since the database does not exists, an exception is thrown at this point.

I am not quite sure on how to fix it, the solutions that come up my mind right now are:

  • Instead of using the getConnection method to return the schema in the pulse migrations, somewhat overwrite the default laravel connection to the pulse connection and then after the migrations writing it back to the default DB_CONNECTION env variable. (Have not tried if this would actually work but i think so)

  • Another solution might be creating an issue/pr agains the laravel framework and running the prepare database function after the migration has been loaded, and against it's connection. I can imagine that this would be not a small task, and that some performace considerations might take place here on running it for every migration

  • Last and not least: Leave it as is, throw the exception and let the developer create the database by himself

Steps To Reproduce

  1. Install pulse
  2. Set the PULSE_DB_CONNECTION env variable to an existing connection but without the configured database in the connection existing.
  3. Run php artisan migrate

RedisClientException on pulse:work (ERR syntax error)

Pulse Version

v1.0.0-beta5

Laravel Version

v10.28.0

PHP Version

8.2.12

Database Driver & Version

MySQL 8.0.35-0ubuntu0.22.04.1 and Redis 6.0.16

Description

I'm trying out Laravel Pulse with PULSE_INGEST_DRIVER=redis

In the AppServiceProvider I've added the following code:

public function boot(): void {
    //

    Pulse::handleExceptionsUsing(function ($e) {
        report($e);
    });
}

I'm running

php artisan pulse:work

In the log file I see the following entries

[2023-12-06 09:41:23] local.ERROR: ERR syntax error {"userId":14,"exception":"[object] (Laravel\\Pulse\\Support\\RedisClientException(code: 0): ERR syntax error at /my-project/vendor/laravel/pulse/src/Support/RedisAdapter.php:117)
[stacktrace]
#0 /my-project/vendor/laravel/framework/src/Illuminate/Support/helpers.php(307): Laravel\\Pulse\\Support\\RedisAdapter->Laravel\\Pulse\\Support\\{closure}()
#1 /my-project/vendor/laravel/pulse/src/Support/RedisAdapter.php(115): tap()
#2 /my-project/vendor/laravel/pulse/src/Support/RedisAdapter.php(72): Laravel\\Pulse\\Support\\RedisAdapter->handle()
#3 /my-project/vendor/laravel/pulse/src/Ingests/RedisIngest.php(58): Laravel\\Pulse\\Support\\RedisAdapter->xtrim()
#4 /my-project/vendor/laravel/pulse/src/Pulse.php(492): Laravel\\Pulse\\Ingests\\RedisIngest->trim()
#5 /my-project/vendor/laravel/pulse/src/Pulse.php(295): Laravel\\Pulse\\Pulse->rescue()
#6 /my-project/vendor/laravel/framework/src/Illuminate/Support/Lottery.php(141): Laravel\\Pulse\\Pulse->Laravel\\Pulse\\{closure}()
#7 /my-project/vendor/laravel/framework/src/Illuminate/Support/Lottery.php(120): Illuminate\\Support\\Lottery->runCallback()
#8 /my-project/vendor/laravel/pulse/src/Pulse.php(296): Illuminate\\Support\\Lottery->choose()
#9 /my-project/vendor/laravel/pulse/src/PulseServiceProvider.php(134): Laravel\\Pulse\\Pulse->store()
#10 /my-project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(227): Laravel\\Pulse\\PulseServiceProvider->Laravel\\Pulse\\{closure}()
#11 /my-project/public/index.php(61): Illuminate\\Foundation\\Http\\Kernel->terminate()
#12 {main}
"} 

In the dashboard I do not see new data coming in. Running with PULSE_INGEST_DRIVER=storage does work.

Steps To Reproduce

  • Use redis as the ingest driver
  • Report pulse errors
  • Click around in the application to generate data
  • Run `php artisan pulse:work
  • Check the logs and see the errors

SQLite Unsupported

Pulse Version

Beta

Laravel Version

Latest

PHP Version

8.1

Description

The documentation doesn't mention this, but when I tried to install locally using sqlite, I got an error related to the md5 function:

CleanShot 2023-12-01 at 18 44 47

Steps To Reproduce

Try to install Pulse in any application that uses SQLite as the default database.

Not working on Laravel 9

Pulse Version

v1.0.0-beta2

Laravel Version

v9.52.16

PHP Version

8.2

Description

Pulse is not working since Benchmark::value was added in Laravel 10.

I can send a PR, but I want to know the best way. Maybe add the method in Laravel 9, add the value method directly to the RemembersQueries trait, or inline the code in the remember method.

Steps To Reproduce

Install Pulse in a Laravel 9 project.

Migration fails when `sql_require_primary_key` is set

Pulse Version

1.0beta

Laravel Version

10

PHP Version

8.1

Description

When sql_require_primary_key is set, the Pulse migration fails:

SQLSTATE[HY000]: General error: 3750 Unable to create or change a table without a primary key, when the system vari  
  able 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message.  
   Note that tables without a primary key can cause performance problems in row-based replication, so please consult   
  your DBA before changing this setting. (Connection: mysql, SQL: create table `pulse_values` (`timestamp` int unsign  
  ed not null, `type` varchar(255) not null, `key` text not null, `key_hash` char(16) character set binary as (unhex(  
  md5(`key`))), `value` text not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')  

It errors on the first table, but presumably will fail on all three tables. This setting is required on Digital Ocean Managed MySQL servers so Pulse can't be installed for any application backed by that service.

pulse_values and pulse_aggregates tables both have a unique index so both tables can probably be created by disabling sql_require_primary_key while the tables are being created.

But pulse_entries doesn't appear to have a column or index that can be used as a primary key so I don't know what to do there.

Steps To Reproduce

  • Set sql_require_primary_key to true in your MySQL configuration.
  • Attempt to install Pulse

DOM does not render in Laravel app updated from 5.8 to 10

Pulse Version

v1.0.0-beta2

Laravel Version

10.34.2

PHP Version

8.1

Description

I have an app updated from Laravel 5.8 to 10.34.2, but when I enter /press path, and do the installation with default configuration; page returns the blank page and the blank head. The HTML and source code of the page renders as is vendor/pulse/dashboard.blade.php. My application does not use alpine or livewire. Any recommendations or steps to follow.

I mention the update from Laravel 5.8 to Laravel 10, because I have another app with Laravel 10, and it worked without problems.
PULSE-CONSOLE

Steps To Reproduce

pulse not populating db entries

Pulse Version

v1.0.0-beta3

Laravel Version

10.34.2

PHP Version

8.1.26

Database Driver & Version

mysql Ver 14.14 Distrib 5.7.35-38, for debian-linux-gnu (x86_64) using 7.0

Description

no db entries are recorded for the tables pulse_entries, pulse_aggregates, and pulse_values

note that the system is in a cluster so the DB is hosted on a different server.

pulse

Steps To Reproduce

Killing pulse:work Orphan Process without htop

Pulse Version

1.0.0

Laravel Version

10.34.2

PHP Version

8.3

Description

After running php artisan pulse:work command, the process runs correctly in the background.

However, after running php artisan pulse:purge and uninstalling the package with composer remove laravel/pulse, the process still exists, and entries keep on getting added to the pulse_aggregates table.

Is there a way to stop the process without using htop? Something like horizon:purge that kills orphan procs.

It would be useful to have a command to kill the orphan pulse:work processes.

Steps To Reproduce

  • Install Pulse
  • Run php artisan pulse:work to start a process
  • Run pulse:purge and uninstall Pulse => the process is still running

Migration fails in pgsql

Pulse Version

1.0.0

Laravel Version

10.34.2

PHP Version

8.2

Database Driver & Version

postgres:13

Description

2023_06_07_000001_create_pulse_tables .................................................................................................. 20ms FAIL

Illuminate\Database\QueryException

SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ","
LINE 1: ...) not null generated always as (unhex(md5(key))), "value" ...
^ (Connection: pgsql, SQL: create table "pulse_values" ("timestamp" integer not null, "type" varchar(255) not null, "key" text not null, "key_hash" char(16) not null generated always as (unhex(md5(key))), "value" text not null))

Steps To Reproduce

I used postgres:13 image in docker-compose, and tried to run migration of pulse.

Unable to create or change a table without a primary key

Pulse Version

1.0@beta

Laravel Version

10.2.9

PHP Version

8.2.12

Database Driver & Version

MySQL 8.0.34-u3-cloud

Description

Trying Pulse on a managed cloud MySQL and it requires primary key for each tables.


  2023_06_07_000001_create_pulse_tables ............................ 12ms FAIL

   Illuminate\Database\QueryException 

  SQLSTATE[HY000]: General error: 3750 Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. (Connection: mysql, SQL: create table `pulse_values` (`timestamp` int unsigned not null, `type` varchar(191) not null, `key` text not null, `key_hash` char(16) character set binary as (unhex(md5(`key`))), `value` text not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = InnoDB)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:822
    818▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    819▕                 );
    820▕             }
    821▕ 
  ➜ 822▕             throw new QueryException(
    823▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    824▕             );
    825▕         }
    826▕     }```
    
    Note those are managed DB and we cannot change the sql_require_primary_key variable.

### Steps To Reproduce

Just run "php artisan migrate" during installation on a Managed MySQL such as one in OCI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.