Skip to content

Commit

Permalink
Merge pull request #27 from flownative/bugfix/26-samplerate-type
Browse files Browse the repository at this point in the history
Fix type of sample rate
  • Loading branch information
kitsunet authored Sep 20, 2024
2 parents 0b8d2e9 + 35de4d3 commit 1be9a48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Classes/SentryClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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'] ?? [];
}

Expand All @@ -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/',
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Flownative:
dsn: "%env:SENTRY_DSN%"
environment: "%env:SENTRY_ENVIRONMENT%"
release: "%env:SENTRY_RELEASE%"
sampleRate: 1
sampleRate: 1.0
capture:
excludeExceptionTypes: []

Expand Down

0 comments on commit 1be9a48

Please sign in to comment.