Skip to content

Commit

Permalink
add sentry replay to dynamic config
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Sep 15, 2024
1 parent 769707e commit 81984f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions assets/dynamic_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"sentryTraces": 0.5,
"sentryProfiles": 0
"sentryTraces": 0.8,
"sentryProfiles": 0.1,
"sentryReplay": 0.1
}
1 change: 1 addition & 0 deletions lib/Backend/dynamic_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DynamicConfigInfo with _$DynamicConfigInfo {
factory DynamicConfigInfo({
@Default(0.5) double sentryTraces,
@Default(0.5) double sentryProfiles,
@Default(0) double sentryReplay,
}) = _DynamicConfigInfo;

factory DynamicConfigInfo.fromJson(Map<String, dynamic> json) => _$DynamicConfigInfoFromJson(json);
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ Future<void> main() async {
..enableMetrics = true
..attachStacktrace = true
..attachScreenshot = true
..attachViewHierarchy = true;
..attachViewHierarchy = true
..experimental.replay.sessionSampleRate = dynamicConfigInfo.sentryReplay;
},
// Init your App.
// ignore: missing_provider_scope
Expand Down

0 comments on commit 81984f6

Please sign in to comment.