Skip to content

Commit

Permalink
fix sentry config for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Nov 14, 2024
1 parent 1752cd0 commit 3e024dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/php/core-bundle/DependencyInjection/AlchemyCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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', [
Expand Down

0 comments on commit 3e024dd

Please sign in to comment.