diff --git a/Classes/SentryClient.php b/Classes/SentryClient.php index c7ab6b8..4325010 100644 --- a/Classes/SentryClient.php +++ b/Classes/SentryClient.php @@ -53,7 +53,7 @@ class SentryClient protected string $dsn; protected string $environment; protected string $release; - protected string $sampleRate; + protected float $sampleRate; protected array $excludeExceptionTypes = []; protected StacktraceBuilder $stacktraceBuilder; @@ -86,7 +86,7 @@ public function injectSettings(array $settings): void $this->dsn = $settings['dsn'] ?? ''; $this->environment = $settings['environment'] ?? ''; $this->release = $settings['release'] ?? ''; - $this->sampleRate = $settings['sampleRate'] ?? 1; + $this->sampleRate = (float)($settings['sampleRate'] ?? 1); $this->excludeExceptionTypes = $settings['capture']['excludeExceptionTypes'] ?? []; } @@ -109,7 +109,7 @@ public function initializeObject(): void 'dsn' => $this->dsn, 'environment' => $this->environment, 'release' => $this->release, - 'sample_rate' => (float)$this->sampleRate, + 'sample_rate' => $this->sampleRate, 'in_app_exclude' => [ FLOW_PATH_ROOT . '/Packages/Application/Flownative.Sentry/Classes/', FLOW_PATH_ROOT . '/Packages/Framework/Neos.Flow/Classes/Aop/', diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 48a89da..99ec675 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -3,7 +3,7 @@ Flownative: dsn: "%env:SENTRY_DSN%" environment: "%env:SENTRY_ENVIRONMENT%" release: "%env:SENTRY_RELEASE%" - sampleRate: 1 + sampleRate: 1.0 capture: excludeExceptionTypes: []