Configuration

Fine tune the CodeInginter monitoring strategy on your needs.

The Ingestion Key is the only required configuration parameter, but the Inspector package is designed to help you deeply customize the monitoring strategy based on your application needs.

Ignore Routes

It could be needed to turn off monitoring based on url. Think about paths like /backend, or other parts of your app that has nothing to do with the user experience.

You can easily ignore these path listing them into the ignoreRoutes array of app/Config/Inspector.php configuration file.

class Inspector extends BaseConfig
{
    ...
    
    /**
     * List the path you don't want to monitor (Support for wildcard "*").
     *
     * @var array
     */
    public $ignoreRoutes = [
        'backend*'
    ];
    
    ...
}

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

Ignore Commands

You can ignore spark commands adding the command name to the ignoreCommands property in the app/Config/Inspector.php configuration file.

class Inspector extends BaseConfig
{
    ...
    
    /**
     * List the commands you don't want to monitor (Support for wildcard "*").
     *
     * @var array
     */
    public $ignoreCommands = [
        'inspector:install',
        'serve',
        'make:*',
        'db:*',
        'migrate',
    ];
    
    ...
}

Access the Inspector instance

You can get the current Inspector instance using the helper function:

// Load the helper
helper('inspector');

// Use the inspector() function
inspector()->addSegment(function () {
    // Your code here...
}, 'type', 'label');

Last updated