From 7f28e32388dff3847f049d7976e2df58eb9686e2 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Wed, 3 Sep 2025 10:59:12 +0800 Subject: [PATCH 1/2] fix: change default values to true in Sentry Switcher Updated default values from false to true for: - isEnable() - isBreadcrumbEnable() - isTracingEnable() - isTracingSpanEnable() - isTracingExtraTagEnable() This ensures Sentry features are enabled by default unless explicitly disabled in configuration. --- src/sentry/src/Switcher.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sentry/src/Switcher.php b/src/sentry/src/Switcher.php index 263249c97..c3ef3e682 100644 --- a/src/sentry/src/Switcher.php +++ b/src/sentry/src/Switcher.php @@ -24,12 +24,12 @@ public function __construct(protected ConfigInterface $config) public function isEnable(string $key): bool { - return (bool) $this->config->get('sentry.enable.' . $key, false); + return (bool) $this->config->get('sentry.enable.' . $key, true); } public function isBreadcrumbEnable(string $key): bool { - return (bool) $this->config->get('sentry.breadcrumbs.' . $key, false); + return (bool) $this->config->get('sentry.breadcrumbs.' . $key, true); } public function isTracingEnable(string $key): bool @@ -38,7 +38,7 @@ public function isTracingEnable(string $key): bool return false; } - return (bool) $this->config->get('sentry.tracing.enable.' . $key, false); + return (bool) $this->config->get('sentry.tracing.enable.' . $key, true); } public function isTracingSpanEnable(string $key): bool @@ -47,12 +47,12 @@ public function isTracingSpanEnable(string $key): bool return false; } - return (bool) $this->config->get('sentry.tracing.spans.' . $key, false); + return (bool) $this->config->get('sentry.tracing.spans.' . $key, true); } public function isTracingExtraTagEnable(string $key): bool { - return (bool) ($this->config->get('sentry.tracing.extra_tags', [])[$key] ?? false); + return (bool) ($this->config->get('sentry.tracing.extra_tags', [])[$key] ?? true); } public function isExceptionIgnored(string|Throwable $exception): bool From fff7dedc71b234ef4bae7a3427e8b22a413b6d89 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Wed, 3 Sep 2025 11:04:03 +0800 Subject: [PATCH 2/2] fix: update tracing extra tag value for consistency in SwitcherTest --- tests/Sentry/SwitcherTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Sentry/SwitcherTest.php b/tests/Sentry/SwitcherTest.php index 35c3dce28..2b220e54d 100644 --- a/tests/Sentry/SwitcherTest.php +++ b/tests/Sentry/SwitcherTest.php @@ -21,7 +21,7 @@ 'extra_tags' => [ 'foo.bar' => true, 'foo.baz' => true, - 'foo.bar.baz' => true, + 'foo.bar.baz' => false, ], ], ], @@ -34,6 +34,6 @@ })->with([ ['foo.bar', true], ['foo.baz', true], - ['foo.bar.baz', true], - ['foo.bay', false], + ['foo.bar.baz', false], + ['foo.bay', true], ]);