-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Transactions for crashes #4504
base: main
Are you sure you want to change the base?
Conversation
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
ddb4778 | 1245.36 ms | 1254.16 ms | 8.80 ms |
020745f | 1222.64 ms | 1253.54 ms | 30.90 ms |
18d491a | 1229.78 ms | 1252.67 ms | 22.90 ms |
077e940 | 1227.31 ms | 1246.51 ms | 19.20 ms |
c319795 | 1256.18 ms | 1266.87 ms | 10.69 ms |
cc31630 | 1235.22 ms | 1252.51 ms | 17.29 ms |
94e1968 | 1234.41 ms | 1252.63 ms | 18.22 ms |
216bdf9 | 1202.57 ms | 1215.45 ms | 12.88 ms |
bb5dc7d | 1240.44 ms | 1266.45 ms | 26.01 ms |
46f5eb8 | 1200.09 ms | 1231.38 ms | 31.29 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
ddb4778 | 21.58 KiB | 414.92 KiB | 393.34 KiB |
020745f | 22.84 KiB | 403.13 KiB | 380.29 KiB |
18d491a | 21.58 KiB | 544.87 KiB | 523.29 KiB |
077e940 | 21.58 KiB | 706.97 KiB | 685.39 KiB |
c319795 | 20.76 KiB | 431.99 KiB | 411.22 KiB |
cc31630 | 21.58 KiB | 694.58 KiB | 672.99 KiB |
94e1968 | 21.58 KiB | 614.74 KiB | 593.15 KiB |
216bdf9 | 21.58 KiB | 418.13 KiB | 396.54 KiB |
bb5dc7d | 22.85 KiB | 412.98 KiB | 390.13 KiB |
46f5eb8 | 20.76 KiB | 432.37 KiB | 411.61 KiB |
Previous results on branch: feat/transactions-for-crashes
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8222b3d | 1212.98 ms | 1240.35 ms | 27.37 ms |
88aa4f6 | 1230.12 ms | 1258.31 ms | 28.18 ms |
fa979fd | 1234.69 ms | 1255.37 ms | 20.67 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8222b3d | 21.90 KiB | 728.22 KiB | 706.32 KiB |
88aa4f6 | 21.90 KiB | 728.19 KiB | 706.29 KiB |
fa979fd | 21.90 KiB | 728.17 KiB | 706.27 KiB |
@brustolin, I still need to fix some problems with the context before you can review this. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4504 +/- ##
=============================================
+ Coverage 91.436% 91.483% +0.046%
=============================================
Files 616 616
Lines 68863 69332 +469
Branches 24707 24861 +154
=============================================
+ Hits 62966 63427 +461
- Misses 5803 5813 +10
+ Partials 94 92 -2
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
SentryTransaction *transaction = [self toTransaction]; | ||
|
||
#if SENTRY_TARGET_PROFILING_SUPPORTED | ||
if (self.isProfiling) { | ||
NSDate *startTimestamp; | ||
|
||
# if SENTRY_HAS_UIKIT | ||
if (appStartMeasurement != nil) { | ||
startTimestamp = appStartMeasurement.runtimeInitTimestamp; | ||
} | ||
# endif // SENTRY_HAS_UIKIT | ||
|
||
if (startTimestamp == nil) { | ||
startTimestamp = self.startTimestamp; | ||
} | ||
if (!SENTRY_ASSERT_RETURN(startTimestamp != nil, | ||
@"A transaction with a profile should have a start timestamp already. We will " | ||
@"assign the current time but this will be incorrect.")) { | ||
startTimestamp = [SentryDependencyContainer.sharedInstance.dateProvider date]; | ||
} | ||
|
||
sentry_captureTransactionWithProfile( | ||
self.hub, self.dispatchQueue, transaction, startTimestamp); | ||
return; | ||
} | ||
#endif // SENTRY_TARGET_PROFILING_SUPPORTED | ||
|
||
[_hub captureTransaction:transaction withScope:_hub.scope]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was already here in a previous version. I only moved it to a different method.
@@ -97,7 +97,7 @@ - (instancetype)initWithScope:(SentryScope *)scope | |||
[_fingerprintArray addObjectsFromArray:[scope fingerprints]]; | |||
[_attachmentArray addObjectsFromArray:[scope attachments]]; | |||
|
|||
self.propagationContext = [[SentryPropagationContext alloc] init]; | |||
self.propagationContext = scope.propagationContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will open an extra PR for this change before merging this PR, as it's a small bug fix that deserves it's own PR.
@brustolin, this is ready for review now. |
📜 Description
Finishes the transaction bound to the scope when the app crashes and stores it to disk. This experimental feature is disabled by default. You can enable it via the option
enableTracingWhenCrashing
.I'm sorry about the large diff, but the PR only makes sense in one significant change. The largest part is the tests.
Docs PR: getsentry/sentry-docs#11732.
💡 Motivation and Context
Fixes GH-2306
💚 How did you test it?
Unit tests, simulator, and a release build via TestFlight.
https://sentry-sdks.sentry.io/issues/6044162827/events/4e25fdce217445b5ab3ecd6eb906a77e/?node=txn-efa80d62c9a4472fa8cfef87320638d2&project=5428557
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.🔮 Next steps