Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump sentry/sentry-laravel from 4.1.1 to 4.2.0 #608

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Sentry\Laravel\Integration;
use Throwable;

class Handler extends ExceptionHandler
Expand Down Expand Up @@ -37,16 +38,7 @@ class Handler extends ExceptionHandler
public function register()
{
$this->reportable(function (Throwable $e) {
//
Integration::captureUnhandledException($e);
});
}

public function report(Throwable $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}

parent::report($exception);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"matthewbdaly/laravel-azure-storage": "^2.0",
"netopia/payment": "^1.0",
"plank/laravel-mediable": "^5.9",
"sentry/sentry-laravel": "^4.1",
"sentry/sentry-laravel": "^4.2",
"spatie/laravel-responsecache": "^7.4",
"spatie/laravel-translatable": "^6.5",
"spatie/laravel-translation-loader": "^2.7",
Expand Down
80 changes: 37 additions & 43 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 73 additions & 27 deletions config/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,102 @@

return [

// @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),

// capture release as git sha
// 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')),
// 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' => env('SENTRY_RELEASE'),

// 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', false),

// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-exceptions
// 'ignore_exceptions' => [],

// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-transactions
// 'ignore_transactions' => [],

// Breadcrumb specific configuration
'breadcrumbs' => [
// Capture Laravel logs in 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 Livewire components like routes as breadcrumbs
'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true),

// Capture SQL queries in 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' => true,
// Capture SQL query bindings (parameters) in SQL query breadcrumbs
'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', false),

// Capture queue job information in 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' => true,
// Capture command information as breadcrumbs
'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true),

// Capture HTTP client request information as breadcrumbs
'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true),
],

// Performance monitoring specific configuration
'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' => true,
'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true),

// Capture SQL queries as spans
'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' => true,
// Capture SQL query bindings (parameters) in SQL query spans
'sql_bindings' => env('SENTRY_TRACE_SQL_BINDINGS_ENABLED', false),

// Capture views as spans
'views' => true,
// Capture where the SQL query originated from on the SQL query spans
'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true),

// Indicates if the tracing integrations supplied by Sentry should be loaded
'default_integrations' => true,
],
// Capture views rendered as spans
'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true),

// Capture Livewire components as spans
'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true),

// Capture HTTP client requests as spans
'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true),

// @see: https://docs.sentry.io/platforms/php/configuration/options/#send-default-pii
'send_default_pii' => false,
// Capture Redis operations as spans (this enables Redis events in Laravel)
'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false),

'traces_sample_rate' => (float) (env('SENTRY_TRACES_SAMPLE_RATE', 0.0)),
// Capture where the Redis command originated from on the Redis command spans
'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true),

'controllers_base_namespace' => env('SENTRY_CONTROLLERS_BASE_NAMESPACE', 'App\\Http\\Controllers'),
// Enable tracing for requests without a matching route (404's)
'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false),

// 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),

// Enable the tracing integrations supplied by Sentry (recommended)
'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true),
],

];