Automatic Instrumentation

The Laravel SDK automatically instruments your application to capture transactions and adds spans for the following features:

  • Views
  • Queue jobs
  • Notifications
  • Database queries
  • Redis operations
  • Laravel HTTP Client requests
  • GraphQL operations (when using Lighthouse)
  • Folio page based routes
  • Livewire components

The Laravel SDK is also capable of creating spans for filesystem access operations. You can enable this feature by wrapping the configuration for all disks with a call to Sentry\Laravel\Features\Storage\Integration::configureDisks():

config/filesystems.php
Copied
'disks' => Sentry\Laravel\Features\Storage\Integration::configureDisks([
    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
        'throw' => false,
    ],

    // ...
], /* enableSpans: */ true, /* enableBreadcrumbs: */ true),

Alternatively, you can enable this feature only for select disks:

config/filesystems.php
Copied
'disks' => [
    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
        'throw' => false,
    ],

    's3' => Sentry\Laravel\Features\Storage\Integration::configureDisk('s3', [
        // ...
    ], /* enableSpans: */ true, /* enableBreadcrumbs: */ true),
],

By default, both spans and breadcrumbs are enabled. You may disable them by passing the second argument, $enableSpans, or the third argument, $enableBreadcrumbs.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").