|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * Sentry Laravel SDK configuration file. |
| 5 | + * |
| 6 | + * @see https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/ |
| 7 | + */ |
| 8 | +return [ |
| 9 | + |
| 10 | + // @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ |
| 11 | + 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), |
| 12 | + |
| 13 | + // @see https://spotlightjs.com/ |
| 14 | + // 'spotlight' => env('SENTRY_SPOTLIGHT', false), |
| 15 | + |
| 16 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#logger |
| 17 | + // 'logger' => Sentry\Logger\DebugFileLogger::class, // By default this will log to `storage_path('logs/sentry.log')` |
| 18 | + |
| 19 | + // The release version of your application |
| 20 | + // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) |
| 21 | + 'release' => env('SENTRY_RELEASE'), |
| 22 | + |
| 23 | + // When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`) |
| 24 | + 'environment' => env('SENTRY_ENVIRONMENT'), |
| 25 | + |
| 26 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample-rate |
| 27 | + 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float) env('SENTRY_SAMPLE_RATE'), |
| 28 | + |
| 29 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate |
| 30 | + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), |
| 31 | + |
| 32 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate |
| 33 | + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), |
| 34 | + |
| 35 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii |
| 36 | + 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), |
| 37 | + |
| 38 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-exceptions |
| 39 | + // 'ignore_exceptions' => [], |
| 40 | + |
| 41 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-transactions |
| 42 | + 'ignore_transactions' => [ |
| 43 | + // Ignore Laravel's default health URL |
| 44 | + '/up', |
| 45 | + ], |
| 46 | + |
| 47 | + // Breadcrumb specific configuration |
| 48 | + 'breadcrumbs' => [ |
| 49 | + // Capture Laravel logs as breadcrumbs |
| 50 | + 'logs' => env('SENTRY_BREADCRUMBS_LOGS_ENABLED', true), |
| 51 | + |
| 52 | + // Capture Laravel cache events (hits, writes etc.) as breadcrumbs |
| 53 | + 'cache' => env('SENTRY_BREADCRUMBS_CACHE_ENABLED', true), |
| 54 | + |
| 55 | + // Capture Livewire components like routes as breadcrumbs |
| 56 | + 'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true), |
| 57 | + |
| 58 | + // Capture SQL queries as breadcrumbs |
| 59 | + 'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES_ENABLED', true), |
| 60 | + |
| 61 | + // Capture SQL query bindings (parameters) in SQL query breadcrumbs |
| 62 | + 'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', false), |
| 63 | + |
| 64 | + // Capture queue job information as breadcrumbs |
| 65 | + 'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO_ENABLED', true), |
| 66 | + |
| 67 | + // Capture command information as breadcrumbs |
| 68 | + 'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true), |
| 69 | + |
| 70 | + // Capture HTTP client request information as breadcrumbs |
| 71 | + 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true), |
| 72 | + |
| 73 | + // Capture send notifications as breadcrumbs |
| 74 | + 'notifications' => env('SENTRY_BREADCRUMBS_NOTIFICATIONS_ENABLED', true), |
| 75 | + ], |
| 76 | + |
| 77 | + // Performance monitoring specific configuration |
| 78 | + 'tracing' => [ |
| 79 | + // Trace queue jobs as their own transactions (this enables tracing for queue jobs) |
| 80 | + 'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', true), |
| 81 | + |
| 82 | + // Capture queue jobs as spans when executed on the sync driver |
| 83 | + 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true), |
| 84 | + |
| 85 | + // Capture SQL queries as spans |
| 86 | + 'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true), |
| 87 | + |
| 88 | + // Capture SQL query bindings (parameters) in SQL query spans |
| 89 | + 'sql_bindings' => env('SENTRY_TRACE_SQL_BINDINGS_ENABLED', false), |
| 90 | + |
| 91 | + // Capture where the SQL query originated from on the SQL query spans |
| 92 | + 'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true), |
| 93 | + |
| 94 | + // Define a threshold in milliseconds for SQL queries to resolve their origin |
| 95 | + 'sql_origin_threshold_ms' => env('SENTRY_TRACE_SQL_ORIGIN_THRESHOLD_MS', 100), |
| 96 | + |
| 97 | + // Capture views rendered as spans |
| 98 | + 'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true), |
| 99 | + |
| 100 | + // Capture Livewire components as spans |
| 101 | + 'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true), |
| 102 | + |
| 103 | + // Capture HTTP client requests as spans |
| 104 | + 'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true), |
| 105 | + |
| 106 | + // Capture Laravel cache events (hits, writes etc.) as spans |
| 107 | + 'cache' => env('SENTRY_TRACE_CACHE_ENABLED', true), |
| 108 | + |
| 109 | + // Capture Redis operations as spans (this enables Redis events in Laravel) |
| 110 | + 'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false), |
| 111 | + |
| 112 | + // Capture where the Redis command originated from on the Redis command spans |
| 113 | + 'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true), |
| 114 | + |
| 115 | + // Capture send notifications as spans |
| 116 | + 'notifications' => env('SENTRY_TRACE_NOTIFICATIONS_ENABLED', true), |
| 117 | + |
| 118 | + // Enable tracing for requests without a matching route (404's) |
| 119 | + 'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false), |
| 120 | + |
| 121 | + // Configures if the performance trace should continue after the response has been sent to the user until the application terminates |
| 122 | + // This is required to capture any spans that are created after the response has been sent like queue jobs dispatched using `dispatch(...)->afterResponse()` for example |
| 123 | + 'continue_after_response' => env('SENTRY_TRACE_CONTINUE_AFTER_RESPONSE', true), |
| 124 | + |
| 125 | + // Enable the tracing integrations supplied by Sentry (recommended) |
| 126 | + 'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true), |
| 127 | + ], |
| 128 | + |
| 129 | +]; |
0 commit comments