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

Spotlight improvements #892

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions config/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
// @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),

// @see https://spotlightjs.com/
'spotlight' => env('SENTRY_SPOTLIGHT', false),

stayallive marked this conversation as resolved.
Show resolved Hide resolved
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#logger
// 'logger' => Sentry\Logger\DebugFileLogger::class, // By default this will log to `storage_path('logs/sentry.log')`

Expand Down
6 changes: 4 additions & 2 deletions src/Sentry/Laravel/BaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function hasDsnSet(): bool
{
$config = $this->getUserConfig();

return !empty($config['dsn']);
return !empty($config['dsn']) || ($config['spotlight'] ?? false) === true;
}
stayallive marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand All @@ -42,12 +42,14 @@ protected function getUserConfig(): array
*
* Because of `traces_sampler` being dynamic we can never be 100% confident but that is also not important.
*
* @deprecated This method is deprecated and will be removed in the next major release.
stayallive marked this conversation as resolved.
Show resolved Hide resolved
*
* @return bool
*/
protected function couldHavePerformanceTracingEnabled(): bool
{
$config = $this->getUserConfig();

return !empty($config['traces_sample_rate']) || !empty($config['traces_sampler']);
return !empty($config['traces_sample_rate']) || !empty($config['traces_sampler']) || ($config['spotlight'] ?? false) === true;
}
}
Loading