Skip to content

Commit

Permalink
get dynamic variable..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Feb 23, 2023
1 parent 614c250 commit 3f29c17
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions app/View/Components/Script/Exceptions/Trackers.php
Expand Up @@ -106,6 +106,8 @@ public function getParams($params)
$params = [
'release' => version('short'),
'traces_sample_rate' => static::sentryTracesSampleRate(),
'replays_session_sample_rate' => static::sentryReplaysSessionSampleRate(),
'replays_on_error_sample_rate' => static::sentryReplaysOnErrorSampleRate(),
];
break;
}
Expand All @@ -129,4 +131,14 @@ public static function sentryTracesSampleRate()

return (float) config('sentry.traces_sample_rate', 1.0);
}

public static function sentryReplaysSessionSampleRate()
{
return (float) config('sentry.replays_session_sample_rate', 0.1);
}

public static function sentryReplaysOnErrorSampleRate()
{
return (float) config('sentry.replays_on_error_sample_rate', 1.0);
}
}
4 changes: 2 additions & 2 deletions resources/assets/js/exceptions/trackers/sentry.js
Expand Up @@ -22,11 +22,11 @@ export default {

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,
replaysSessionSampleRate: exception_tracker.params.replays_session_sample_rate,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,
replaysOnErrorSampleRate: exception_tracker.params.replays_on_error_sample_rate,
});

Sentry.setUser({
Expand Down

0 comments on commit 3f29c17

Please sign in to comment.