File tree Expand file tree Collapse file tree 3 files changed +28
-24
lines changed
performance/traces-sample-rate
user-feedback/sdk-api-example Expand file tree Collapse file tree 3 files changed +28
-24
lines changed Original file line number Diff line number Diff line change 11``` dart
2- import 'package:sentry/sentry.dart';
3-
4- Sentry.init(( options) => {
5- options.tracesSampleRate = 0.2 ,
6- } );
2+ Sentry.init(
3+ (options) {
4+ options.tracesSampleRate = 0.2;
5+ } ,
6+ );
77```
Original file line number Diff line number Diff line change @@ -6,17 +6,19 @@ class MyRpcException implements Exception {
66 MyRpcException(this.function, this.httpStatusCode);
77}
88
9- await SentryFlutter.init((options) {
10- options.beforeSend = (event, hint) {
11- if (event.throwable is MyRpcException) {
12- final exception = event.throwable as MyRpcException;
13- event = event.copyWith(fingerprint: [
14- '{{ default }}',
15- exception.function,
16- exception.httpStatusCode.toString(),
17- ]);
18- }
19- return event;
20- };
21- };
9+ await SentryFlutter.init(
10+ (options) {
11+ options.beforeSend = (event, hint) {
12+ if (event.throwable is MyRpcException) {
13+ final exception = event.throwable as MyRpcException;
14+ event = event.copyWith(fingerprint: [
15+ '{{ default }}',
16+ exception.function,
17+ exception.httpStatusCode.toString(),
18+ ]);
19+ }
20+ return event;
21+ };
22+ },
23+ );
2224```
Original file line number Diff line number Diff line change 22// Option 1: Retrieving SentryId from beforeSend
33SentryId sentryId = SentryId.empty();
44
5- await SentryFlutter.init((options) {
6- options.beforeSend = (event, hint) {
7- sentryId = event.eventId;
8- return event;
9- };
10- });
5+ await SentryFlutter.init(
6+ (options) {
7+ options.beforeSend = (event, hint) {
8+ sentryId = event.eventId;
9+ return event;
10+ };
11+ },
12+ );
1113
1214// Option 2: Retrieving SentryId from the method capturing the event
1315SentryId sentryId = Sentry.captureMessage("My message");
You can’t perform that action at this time.
0 commit comments