feat(monitoring): integrate sentry with tenant context and gitea actions
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 48s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 48s
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Sentry\State\Scope;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -26,6 +27,18 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
|
||||
if (function_exists('tenant')) {
|
||||
\Sentry\configureScope(function (Scope $scope): void {
|
||||
if (tenant('id')) {
|
||||
$scope->setTag('tenant_id', tenant('id'));
|
||||
$scope->setContext('tenant', [
|
||||
'id' => tenant('id'),
|
||||
'data' => tenant()->toArray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$this->overrideCoreConfigDefaults();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user