From bfe191843d138336158d408fdfb9f2383f70e83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Mon, 31 Jul 2023 16:09:19 +0300 Subject: [PATCH] updated `sentry` config --- config/sentry.php | 112 +++++++++++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 46 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index 69906636180..2030a3bd883 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -1,87 +1,107 @@ env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), - // capture release as git sha + // The release version of your application + // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - // When left empty or `null` the Laravel environment will be used + // When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`) 'environment' => env('SENTRY_ENVIRONMENT'), + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample-rate + 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float)env('SENTRY_SAMPLE_RATE'), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii + 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', true), + + 'before_send' => [env('SENTRY_BEFORE_SEND_CLASS', 'App\\Exceptions\\Trackers\\Sentry'), 'beforeSend'], + + 'traces_sampler' => [env('SENTRY_TRACES_SAMPLER_CLASS', 'App\\Exceptions\\Trackers\\Sentry'), 'tracesSampler'], + 'breadcrumbs' => [ - // Capture Laravel logs in breadcrumbs - 'logs' => env('SENTRY_BREADCRUMBS_LOGS', true), + // Capture Laravel logs as breadcrumbs + 'logs' => env('SENTRY_BREADCRUMBS_LOGS_ENABLED', true), + + // Capture Laravel cache events (hits, writes etc.) as breadcrumbs + 'cache' => env('SENTRY_BREADCRUMBS_CACHE_ENABLED', true), - // Capture Laravel cache events in breadcrumbs - 'cache' => env('SENTRY_BREADCRUMBS_CACHE', true), + // Capture Livewire components as breadcrumbs + 'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true), - // Capture Livewire components in breadcrumbs - 'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE', true), + // Capture storage access as breadcrumbs + 'storage' => env('SENTRY_BREADCRUMBS_STORAGE_ENABLED', true), - // Capture SQL queries in breadcrumbs - 'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES', true), + // Capture SQL queries as breadcrumbs + 'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES_ENABLED', true), - // Capture bindings on SQL queries logged in breadcrumbs - 'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS', true), + // Capture bindings on SQL queries logged as breadcrumbs + 'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', true), - // Capture queue job information in breadcrumbs - 'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO', true), + // Capture queue job information as breadcrumbs + 'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO_ENABLED', true), - // Capture command information in breadcrumbs - 'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_INFO', true), + // Capture command information as breadcrumbs + 'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true), - // Capture HTTP client requests information in breadcrumbs - 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS', true), + // Capture HTTP client requests information as breadcrumbs + 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true), ], 'tracing' => [ - // Trace queue jobs as their own transactions + // Trace queue jobs as their own transactions (this enables tracing for queue jobs) 'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', false), // Capture queue jobs as spans when executed on the sync driver - 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS', true), + 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true), // Capture SQL queries as spans - 'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES', true), + 'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true), - // Try to find out where the SQL query originated from and add it to the query spans - 'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN', true), + // Capture where the SQL query originated from on the SQL query spans + 'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true), - // Capture views as spans - 'views' => env('SENTRY_TRACE_VIEWS', true), + // Capture views rendered as spans + 'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true), + + // Capture storage access as spans + 'storage' => env('SENTRY_TRACE_STORAGE_ENABLED', true), // Capture Livewire components as spans - 'livewire' => env('SENTRY_TRACE_LIVEWIRE', true), + 'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true), // Capture HTTP client requests as spans - 'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS', true), + 'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true), // Capture Redis operations as spans (this enables Redis events in Laravel) - 'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false), - - // Try to find out where the Redis command originated from and add it to the command spans - 'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN', true), - - // Indicates if the tracing integrations supplied by Sentry should be loaded - 'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS', true), + 'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS_ENABLED', false), - // Indicates that requests without a matching route should be traced - 'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES', false), - ], + // Capture where the Redis command originated from on the Redis command spans + 'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true), - // @see: https://docs.sentry.io/platforms/php/configuration/options/#send-default-pii - 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', true), + // Enable tracing for requests without a matching route (404's) + 'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false), - // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate - 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), + // Configures if the performance trace should continue after the response has been sent to the user until the application terminates + // 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 + 'continue_after_response' => env('SENTRY_TRACE_CONTINUE_AFTER_RESPONSE', true), - 'before_send' => [env('SENTRY_BEFORE_SEND_CLASS', 'App\\Exceptions\\Trackers\\Sentry'), 'beforeSend'], - - 'traces_sampler' => [env('SENTRY_TRACES_SAMPLER_CLASS', 'App\\Exceptions\\Trackers\\Sentry'), 'tracesSampler'], - - 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), + // Enable the tracing integrations supplied by Sentry (recommended) + 'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true), + ], ];