Configuration

Customize the package behaviour.

Environment Variables

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

Variable

Type

Default

Description

INSPECTOR_API_KEY

string

Your application key to identify uniquely your application in Inspector.

INSPECTOR_ENABLE

boolean

true

Enable/Disable data transfer from your app to Inspection API.

INSPECTOR_TRANSPORT

string

sync

INSPECTOR_QUERY

boolean

true

Determine if Inspector will report database queries.

INSPECTOR_QUERY_BINDINGS

boolean

false

Determine if Inspector will report binding values for queries.

INSPECTOR_USER

boolean

true

Determine if Inspector will attach user information in your events.

INSPECTOR_EMAIL

boolean

true

Determine if Inspector will report emails.

INSPECTOR_NOTIFICATIONS

boolean

true

Determine if Inspector will report notifications.

INSPECTOR_JOB

boolean

true

Determine if Inspector will report queued jobs execution.

INSPECTOR_UNHANDLED_EXCEPTIONS

boolean

true

Determine if Inspector will report unhandled exception fired in your application.

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

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

That will add config/inspector.php file in your Laravel configuration directory.

Master Switch

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

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

Ignore transactions

Not any 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.

Also could be some part of your application that you need to exclude by a specific url, like /nova, /telescope, or other not relevant path generated from other packages.

Inspector gives you the ability to ignore these parts of your application adding appropriate rules in the app/inspector.php configuration file:

/*
|---------------------------------------------------------------------
| 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*',
],
/*
|---------------------------------------------------------------------
| 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',
],

Transport

Inspector start to send data to the Inspection API after your application has sent the response to the user. This guarantee optimal performance from your users point of view.

By default the package use php CURL extension to send data out of your server in a synchronous way. This means that after response has sent to the user, your application still working for a few milliseconds to accomplish data transfer and your php engine can't close the execution if CURL isn't finished.

The maximum timout accepted is 1 second, after this time the data transfer process will be stopped to avoid too long processes in the background.

If your backend serves a huge amount of traffic you could prefer to execute data transfer in background (async) at server level and leave the php engine free to close its execution. The package will run CURL from exec function, like a cli command, so data transfer is executed silently and your script will terminate immediately.

Async transport works only on UNIX based system.

Although async is the most efficient way to send data, you will not be able to know if the transfer fails and why. Instead using the sync method the package records any failures in the apache logs for debugging purpose. Consider to start using sync method and when your are sure that everything is working on your server you can switch to async.

You may active async transport setting to async the INSPECTOR_TRANSPORT environment variable:

INSPECTOR_TRANSPORT=async