Laravel 4 and 5 are supported out of the box in Tideways for automatic transaction detection and instrumentation of events, templates, bootstrapping and controllers. In addition several Eloquent query APIs for SELECT, UPDATE, INSERT and DELETE are instrumented.

To configure the transaction detection you have to configure the framework as laravel, for example in .ini:


The following Laravel code blocks are instrumented automatically by the PHP extension:

  • Events dispatched through event() or Illuminate\\Events\\Dispatcher::fire

  • Templates rendered with the Blade template engine

  • Controllers

  • Duration of boot

  • Session middleware cleanup/garbage collection

  • Eloquent Queries

    • SELECT queries executed through Illuminate\Database\Eloquent\Builder::getModels

    • Write operations performed through Illuminate\Database\\Eloquent\Model methods performInsert, performUpdate, delete and destroy.

Laravel Queue instrumentation

If you are making use of the Laravel Queues feature, then instrumenting the duration of individual jobs inside the workers can increase insight into the performance of your background jobs.

Instrumentation of worker jobs has to be integrated manually at the moment, not automatic support exists yet. You need to hook into the before, after and failing events, for example from an AppServiceProvider or from a dedicated Tideways service provider:


namespace App\Providers;

use Tideways\Profiler;

class TidewaysProvider extends ServiceProvider
    private $sampleRate = 10;
    private $service = 'worker';

    public function boot()
        if (!class_exists('Tideways\Profiler')) {

        Queue::before(function (JobProcessing $event) {
            // Assumption: API Key is set via php.ini or environment variable
            // Set 'api_key' option otherwise
                'sample_rate' => $this->sampleRate

        Queue::after(function (JobProcessed $event) {

        Queue::failing(function (JobFailed $event) {

    public function register()
The API Key must be set via php.ini or environment variable if not provided to Profiler::start.

Register the TidewaysProvider in config/app.php file by adding it to the providers key in the array:


'providers' => [
    // Other Service Providers
Still need help? Email [email protected]