Configuration

Customize the monitoring strategy in your Laravel application.

If you want full control of the package behaviour publish the configuration file:

php artisan vendor:publish --provider="Inspector\Laravel\InspectorServiceProvider"

This comand will create the config/inspector.php file.

Environment Variables

You can use the following environment variables to determine how Inspector will collect information for your application:

Master Switch

If desired, you may disable data transfer setting to false the enable configuration option:

'enable' => env('INSPECTOR_ENABLE', true),

Ignore transactions (urls, commands, jobs)

Not all transactions need to be monitored in your application. Think about the artisan commands used for application maintainance or deployment, like: migrate:xxx, queue:xxx , horizon:xxx, or other parts of your app that is built for internal use and aren't reachable by users.

You have many options to keep off the noise, and only monitor what metter.

To add these customizations you need to publish the inspector.php configuration file if you haven't already: php artisan vendor:publish --provider="Inspector\Laravel\InspectorServiceProvider"

Ignore URLs

It could be needed to turn off monitoring based on url. Think about paths like /nova, /telescope, or other parts of your app that don't affect the user experience.

You can also use the wildcard character * to exclude all sub-paths.

/*
 |---------------------------------------------------------------------
 | Web request url to ignore
 |---------------------------------------------------------------------
 |
 | Add at this list the url schemes that you don't want monitoring
 | in your Inspector dashboard. You can also use wildcard expression (*).
 |
 */
 
'ignore_url' => [
    'telescope*',
    'vendor/telescope*',
    'horizon*',
    'vendor/horizon*',
],

Ignore Commands

You can ignore artisan commands adding the command signature to the ignore_commands parameter in the config/inspector.php configuration file.

/*
 |---------------------------------------------------------------------
 | Artisan command to ignore
 |---------------------------------------------------------------------
 |
 | Add at this list all command signature that you don't want monitoring
 | in your Inspector dashboard.
 |
 */
 
'ignore_commands' => [
    'migrate:rollback',
    'migrate:fresh',
    'migrate:reset',
    'migrate:install',
    'package:discover',
    'queue:listen',
    'queue:work',
    'horizon',
    'horizon:work',
    'horizon:supervisor',
],

Ignore Jobs

You can also ignore background jobs adding classes to the ignore_jobs property:

/*
|--------------------------------------------------------------------------
| Job classes to ignore
|--------------------------------------------------------------------------
|
| Add at this list the job classes that you don't want monitor.
|
*/

'ignore_jobs' => [
    //\App\Jobs\MyJob::class
],

Last updated