akaunting/config/sentry.php

102 lines
4.8 KiB
PHP
Raw Permalink Normal View History

2022-10-17 14:19:42 +03:00
<?php
2023-07-31 16:09:19 +03:00
/**
* Sentry Laravel SDK configuration file.
*
* @see https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/
*/
2022-10-17 14:19:42 +03:00
return [
2023-05-11 00:11:39 +03:00
// @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/
2022-10-17 14:19:42 +03:00
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
2023-07-31 16:09:19 +03:00
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
2022-10-17 14:19:42 +03:00
// 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
2023-07-31 16:09:19 +03:00
// When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`)
2022-10-17 14:19:42 +03:00
'environment' => env('SENTRY_ENVIRONMENT'),
2023-07-31 16:09:19 +03:00
// @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'],
2022-10-17 14:19:42 +03:00
'breadcrumbs' => [
2023-07-31 16:09:19 +03:00
// 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),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Capture Livewire components as breadcrumbs
'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true),
2023-03-16 18:16:05 +03:00
2023-07-31 16:09:19 +03:00
// Capture SQL queries as breadcrumbs
'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES_ENABLED', true),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Capture bindings on SQL queries logged as breadcrumbs
'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', true),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Capture queue job information as breadcrumbs
'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO_ENABLED', true),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Capture command information as breadcrumbs
'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true),
2023-03-18 01:23:57 +03:00
2023-07-31 16:09:19 +03:00
// Capture HTTP client requests information as breadcrumbs
'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true),
2022-10-17 14:19:42 +03:00
],
'tracing' => [
2023-07-31 16:09:19 +03:00
// Trace queue jobs as their own transactions (this enables tracing for queue jobs)
2022-10-17 14:19:42 +03:00
'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', false),
// Capture queue jobs as spans when executed on the sync driver
2023-07-31 16:09:19 +03:00
'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true),
2022-10-17 14:19:42 +03:00
// Capture SQL queries as spans
2023-07-31 16:09:19 +03:00
'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Capture where the SQL query originated from on the SQL query spans
'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Capture views rendered as spans
'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true),
2023-03-16 18:16:05 +03:00
// Capture Livewire components as spans
2023-07-31 16:09:19 +03:00
'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true),
2023-03-16 18:16:05 +03:00
2023-02-03 01:39:26 +03:00
// Capture HTTP client requests as spans
2023-07-31 16:09:19 +03:00
'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true),
2023-02-03 01:39:26 +03:00
2023-03-16 18:16:05 +03:00
// Capture Redis operations as spans (this enables Redis events in Laravel)
2023-07-31 16:09:19 +03:00
'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS_ENABLED', false),
2022-12-02 13:34:13 +03:00
2023-07-31 16:09:19 +03:00
// Capture where the Redis command originated from on the Redis command spans
'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Enable tracing for requests without a matching route (404's)
'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// 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),
2022-10-17 14:19:42 +03:00
2023-07-31 16:09:19 +03:00
// Enable the tracing integrations supplied by Sentry (recommended)
'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true),
],
2023-05-11 00:11:39 +03:00
2022-10-17 14:19:42 +03:00
];