|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +/** |
| 4 | + * Sentry Laravel SDK configuration file. |
| 5 | + * |
| 6 | + * @see https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/ |
| 7 | + */ |
3 | 8 | return [ |
4 | 9 |
|
5 | 10 | // @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ |
|
9 | 14 | // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) |
10 | 15 | 'release' => env('SENTRY_RELEASE'), |
11 | 16 |
|
12 | | - // When left empty or `null` the Laravel environment will be used |
| 17 | + // When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`) |
13 | 18 | 'environment' => env('SENTRY_ENVIRONMENT'), |
14 | 19 |
|
| 20 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample-rate |
| 21 | + 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float)env('SENTRY_SAMPLE_RATE'), |
| 22 | + |
| 23 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate |
| 24 | + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), |
| 25 | + |
| 26 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate |
| 27 | + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'), |
| 28 | + |
| 29 | + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii |
| 30 | + 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), |
| 31 | + |
| 32 | + // Breadcrumb specific configuration |
15 | 33 | 'breadcrumbs' => [ |
16 | | - // Capture Laravel logs in breadcrumbs |
17 | | - 'logs' => true, |
| 34 | + // Capture Laravel logs as breadcrumbs |
| 35 | + 'logs' => env('SENTRY_BREADCRUMBS_LOGS_ENABLED', true), |
18 | 36 |
|
19 | | - // Capture Laravel cache events in breadcrumbs |
20 | | - 'cache' => true, |
| 37 | + // Capture Laravel cache events (hits, writes etc.) as breadcrumbs |
| 38 | + 'cache' => env('SENTRY_BREADCRUMBS_CACHE_ENABLED', true), |
21 | 39 |
|
22 | | - // Capture storage access as breadcrumbs |
23 | | - 'storage' => true, |
24 | 40 |
|
25 | | - // Capture Livewire components in breadcrumbs |
26 | | - 'livewire' => true, |
| 41 | + // Capture Livewire components like routes as breadcrumbs |
| 42 | + 'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true), |
| 43 | + |
| 44 | + // Capture storage access as breadcrumbs |
| 45 | + 'storage' => env('SENTRY_BREADCRUMBS_STORAGE_ENABLED', true), |
27 | 46 |
|
28 | | - // Capture SQL queries in breadcrumbs |
29 | | - 'sql_queries' => true, |
| 47 | + // Capture SQL queries as breadcrumbs |
| 48 | + 'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES_ENABLED', true), |
30 | 49 |
|
31 | | - // Capture bindings on SQL queries logged in breadcrumbs |
32 | | - 'sql_bindings' => false, |
| 50 | + // Capture SQL query bindings (parameters) in SQL query breadcrumbs |
| 51 | + 'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', false), |
33 | 52 |
|
34 | | - // Capture queue job information in breadcrumbs |
35 | | - 'queue_info' => true, |
| 53 | + // Capture queue job information as breadcrumbs |
| 54 | + 'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO_ENABLED', true), |
36 | 55 |
|
37 | | - // Capture command information in breadcrumbs |
38 | | - 'command_info' => true, |
| 56 | + // Capture command information as breadcrumbs |
| 57 | + 'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true), |
39 | 58 |
|
40 | | - // Capture HTTP client requests information in breadcrumbs |
41 | | - 'http_client_requests' => true, |
| 59 | + // Capture HTTP client request information as breadcrumbs |
| 60 | + 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true), |
42 | 61 | ], |
43 | 62 |
|
| 63 | + // Performance monitoring specific configuration |
44 | 64 | 'tracing' => [ |
45 | | - // Trace queue jobs as their own transactions |
| 65 | + // Trace queue jobs as their own transactions (this enables tracing for queue jobs) |
46 | 66 | 'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', false), |
47 | 67 |
|
48 | 68 | // Capture queue jobs as spans when executed on the sync driver |
49 | | - 'queue_jobs' => true, |
| 69 | + 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true), |
50 | 70 |
|
51 | 71 | // Capture SQL queries as spans |
52 | | - 'sql_queries' => true, |
| 72 | + 'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true), |
53 | 73 |
|
54 | | - // Try to find out where the SQL query originated from and add it to the query spans |
55 | | - 'sql_origin' => true, |
| 74 | + // Capture where the SQL query originated from on the SQL query spans |
| 75 | + 'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true), |
56 | 76 |
|
57 | | - // Capture views as spans |
58 | | - 'views' => true, |
| 77 | + // Capture views rendered as spans |
| 78 | + 'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true), |
59 | 79 |
|
60 | 80 | // Capture storage access as spans |
61 | | - 'storage' => true, |
| 81 | + 'storage' => env('SENTRY_TRACE_STORAGE_ENABLED', true), |
62 | 82 |
|
63 | 83 | // Capture Livewire components as spans |
64 | | - 'livewire' => true, |
| 84 | + 'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true), |
65 | 85 |
|
66 | 86 | // Capture HTTP client requests as spans |
67 | | - 'http_client_requests' => true, |
| 87 | + 'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true), |
68 | 88 |
|
69 | 89 | // Capture Redis operations as spans (this enables Redis events in Laravel) |
70 | 90 | 'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false), |
71 | 91 |
|
72 | | - // Try to find out where the Redis command originated from and add it to the command spans |
73 | | - 'redis_origin' => true, |
| 92 | + // Capture where the Redis command originated from on the Redis command spans |
| 93 | + 'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true), |
74 | 94 |
|
75 | | - // Indicates if the tracing integrations supplied by Sentry should be loaded |
76 | | - 'default_integrations' => true, |
| 95 | + // Enable tracing for requests without a matching route (404's) |
| 96 | + 'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false), |
77 | 97 |
|
78 | | - // Indicates that requests without a matching route should be traced |
79 | | - 'missing_routes' => false, |
80 | | - |
81 | | - // Indicates if the performance trace should continue after the response has been sent to the user until the application terminates |
| 98 | + // Configures if the performance trace should continue after the response has been sent to the user until the application terminates |
82 | 99 | // 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 |
83 | | - 'continue_after_response' => true, |
84 | | - ], |
85 | | - |
86 | | - // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii |
87 | | - 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), |
| 100 | + 'continue_after_response' => env('SENTRY_TRACE_CONTINUE_AFTER_RESPONSE', true), |
88 | 101 |
|
89 | | - // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate |
90 | | - 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), |
91 | | - |
92 | | - 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'), |
| 102 | + // Enable the tracing integrations supplied by Sentry (recommended) |
| 103 | + 'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true), |
| 104 | + ], |
93 | 105 |
|
94 | 106 | ]; |
0 commit comments