From 3e024dd301ba3cfdb6c81dfa4ddda337171f3193 Mon Sep 17 00:00:00 2001 From: Arthur de Moulins Date: Thu, 14 Nov 2024 18:18:07 +0100 Subject: [PATCH] fix sentry config for prod --- .../DependencyInjection/AlchemyCoreExtension.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/php/core-bundle/DependencyInjection/AlchemyCoreExtension.php b/lib/php/core-bundle/DependencyInjection/AlchemyCoreExtension.php index f9c3c22fc..df5d22ba9 100644 --- a/lib/php/core-bundle/DependencyInjection/AlchemyCoreExtension.php +++ b/lib/php/core-bundle/DependencyInjection/AlchemyCoreExtension.php @@ -152,8 +152,7 @@ public function prepend(ContainerBuilder $container): void } if (isset($bundles['SentryBundle'])) { - $container->prependExtensionConfig('sentry', [ - 'dsn' => $env === 'prod' ? '%env(SENTRY_DSN)%' : null, + $sentryConfig = [ 'tracing' => [ 'dbal' => [ 'enabled' => false, @@ -183,7 +182,12 @@ public function prepend(ContainerBuilder $container): void NotAcceptableHttpException::class, ], ], - ]); + ]; + + if ($env !== 'prod') { + $sentryConfig['dsn'] = null; + } + $container->prependExtensionConfig('sentry', $sentryConfig); if (isset($bundles['MonologBundle'])) { $container->prependExtensionConfig('sentry', [