Skip to content

Commit

Permalink
Merge branch 'main' into feat/append-http-response-body
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Jul 25, 2023
2 parents 4b34e70 + 33d0587 commit 3340c39
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[Trace origin](https://develop.sentry.dev/sdk/performance/trace-origin/) indicates what created a trace or a span. Not all transactions and spans contain enough information to tell whether the user or what precisely in the SDK created it. Origin solves this problem. The SDK now sends origin for transactions and spans.

- Append http response body ([#1557](https://github.com/getsentry/sentry-dart/pull/1557))
- Add `appHangTimeoutInterval` to `SentryFlutterOptions` ([#1568](https://github.com/getsentry/sentry-dart/pull/1568))

### Dependencies

Expand Down
4 changes: 4 additions & 0 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
if let enableAppHangTracking = arguments["enableAppHangTracking"] as? Bool {
options.enableAppHangTracking = enableAppHangTracking
}

if let appHangTimeoutIntervalMillis = arguments["appHangTimeoutIntervalMillis"] as? UInt {
options.appHangTimeoutInterval = TimeInterval(appHangTimeoutIntervalMillis) / 1000
}
}

private func logLevelFrom(diagnosticLevel: String) -> SentryLevel {
Expand Down
2 changes: 2 additions & 0 deletions flutter/lib/src/integrations/native_sdk_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class NativeSdkIntegration implements Integration<SentryFlutterOptions> {
'enableAppHangTracking': options.enableAppHangTracking,
'connectionTimeoutMillis': options.connectionTimeout.inMilliseconds,
'readTimeoutMillis': options.readTimeout.inMilliseconds,
'appHangTimeoutIntervalMillis':
options.appHangTimeoutInterval.inMilliseconds,
});

options.sdk.addIntegration('nativeSdkIntegration');
Expand Down
10 changes: 9 additions & 1 deletion flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,18 @@ class SentryFlutterOptions extends SentryOptions {
bool attachViewHierarchy = false;

/// When enabled, the SDK tracks when the application stops responding for a
/// specific amount of time (default 2s).
/// specific amount of time, See [appHangTimeoutInterval].
/// Only available on iOS and macOS.
bool enableAppHangTracking = true;

/// The minimum amount of time an app should be unresponsive to be classified
/// as an App Hanging. The actual amount may be a little longer. Avoid using
/// values lower than 100ms, which may cause a lot of app hangs events being
/// transmitted.
/// Default to 2s.
/// Only available on iOS and macOS.
Duration appHangTimeoutInterval = Duration(seconds: 2);

/// Connection timeout. This will only be synced to the Android native SDK.
Duration connectionTimeout = Duration(seconds: 5);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void main() {
'enableAppHangTracking': true,
'connectionTimeoutMillis': 5000,
'readTimeoutMillis': 5000,
'appHangTimeoutIntervalMillis': 2000,
});
});

Expand Down Expand Up @@ -100,7 +101,8 @@ void main() {
..captureFailedRequests = false
..enableAppHangTracking = false
..connectionTimeout = Duration(milliseconds: 9001)
..readTimeout = Duration(milliseconds: 9002);
..readTimeout = Duration(milliseconds: 9002)
..appHangTimeoutInterval = Duration(milliseconds: 9003);

options.sdk.addIntegration('foo');
options.sdk.addPackage('bar', '1');
Expand Down Expand Up @@ -143,6 +145,7 @@ void main() {
'enableAppHangTracking': false,
'connectionTimeoutMillis': 9001,
'readTimeoutMillis': 9002,
'appHangTimeoutIntervalMillis': 9003,
});
});

Expand Down

0 comments on commit 3340c39

Please sign in to comment.