Skip to content
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: Split up UIKit and App Init App Start Spans #3534

Merged
merged 3 commits into from
Jan 4, 2024

Conversation

philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Jan 4, 2024

📜 Description

Split the UIKit and Application Init span into one span for UIKit Init and another for Application Init. The UIKit Init span ends when the users start the SentrySDK. We recommend that the SentrySDK is the first to call in the UIApplication.didFinishLaunching method because otherwise, users won't receive any potential crash reports for code running before our SDK. Therefore, we pick the start time of our SDK as when the UIApplicationDelegate.didFinishLaunching is called.

Docs PR getsentry/sentry-docs#8814.

Before

CleanShot 2024-01-04 at 10 43 21@2x

Now

CleanShot 2024-01-04 at 10 41 12@2x

💡 Motivation and Context

Fixes GH-3345

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Split the UIKit and Application Init span into one span for UIKit Init
and another for Application Init. The UIKit Init span ends when the
users start the SentrySDK. We recommend that the SentrySDK is the first
to call in the UIApplication.didFinishLaunching method because
otherwise, users won't receive any potential crash reports for code
running before our SDK. Therefore, we pick the start time of our SDK as
when the UIApplicationDelegate.didFinishLaunching is called.

Fixes GH-3345
Copy link

github-actions bot commented Jan 4, 2024

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Split up UIKit and App Init App Start Spans ([#3534](https://github.com/getsentry/sentry-cocoa/pull/3534))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against cc4f99d

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f74904f) 89.213% compared to head (b1c6c84) 89.234%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3534       +/-   ##
=============================================
+ Coverage   89.213%   89.234%   +0.020%     
=============================================
  Files          528       528               
  Lines        57620     57472      -148     
  Branches     20637     20334      -303     
=============================================
- Hits         51405     51285      -120     
- Misses        5185      5271       +86     
+ Partials      1030       916      -114     
Files Coverage Δ
Sources/Sentry/SentryAppStartMeasurement.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryAppStartTracker.m 97.619% <100.000%> (+0.014%) ⬆️
Sources/Sentry/SentryBuildAppStartSpans.m 95.384% <100.000%> (+0.384%) ⬆️
Sources/Sentry/SentrySDK.m 90.123% <100.000%> (+0.123%) ⬆️
...SentryProfilerTests/SentryProfilerSwiftTests.swift 97.855% <100.000%> (+0.086%) ⬆️
.../AppStartTracking/SentryAppStartTrackerTests.swift 98.500% <100.000%> (+0.007%) ⬆️
Tests/SentryTests/Protocol/TestData.swift 98.936% <100.000%> (+0.003%) ⬆️
Tests/SentryTests/SentrySDKTests.swift 97.500% <100.000%> (+0.047%) ⬆️
...ts/SentryTests/Transaction/SentryTracerTests.swift 98.869% <100.000%> (-0.005%) ⬇️

... and 86 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f74904f...b1c6c84. Read the comment docs.

Copy link

github-actions bot commented Jan 4, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1230.18 ms 1251.83 ms 21.65 ms
Size 21.58 KiB 418.82 KiB 397.24 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e681215 6240.94 ms 6254.36 ms 13.42 ms
4053ee9 1248.04 ms 1250.82 ms 2.78 ms
302ee8b 1194.02 ms 1223.34 ms 29.32 ms
25bcc50 1240.47 ms 1254.70 ms 14.23 ms
cce35c6 1228.88 ms 1241.14 ms 12.26 ms
7bb0873 1226.18 ms 1247.30 ms 21.12 ms
10ee2ce 1250.90 ms 1258.57 ms 7.67 ms
7bc3c0d 1212.35 ms 1228.94 ms 16.59 ms
f587451 1271.63 ms 1275.90 ms 4.27 ms
d61b939 1238.61 ms 1240.08 ms 1.47 ms

App size

Revision Plain With Sentry Diff
e681215 20.76 KiB 431.91 KiB 411.15 KiB
4053ee9 20.76 KiB 435.22 KiB 414.46 KiB
302ee8b 20.76 KiB 419.62 KiB 398.87 KiB
25bcc50 20.76 KiB 427.22 KiB 406.46 KiB
cce35c6 20.76 KiB 425.80 KiB 405.04 KiB
7bb0873 22.85 KiB 407.09 KiB 384.24 KiB
10ee2ce 20.76 KiB 427.77 KiB 407.00 KiB
7bc3c0d 20.76 KiB 427.35 KiB 406.59 KiB
f587451 20.76 KiB 435.25 KiB 414.49 KiB
d61b939 22.85 KiB 407.63 KiB 384.78 KiB

Previous results on branch: feat/did-finish-launching-span

Startup times

Revision Plain With Sentry Diff
443cce2 1203.04 ms 1220.21 ms 17.17 ms
baaa45f 1214.87 ms 1245.02 ms 30.15 ms

App size

Revision Plain With Sentry Diff
443cce2 21.58 KiB 418.82 KiB 397.24 KiB
baaa45f 21.58 KiB 418.82 KiB 397.24 KiB

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philipphofmann philipphofmann merged commit 2f9c5f9 into main Jan 4, 2024
46 checks passed
@philipphofmann philipphofmann deleted the feat/did-finish-launching-span branch January 4, 2024 13:10
philipphofmann added a commit that referenced this pull request Jan 10, 2024
Split the UIKit and Application Init span into one span for UIKit Init
and another for Application Init. The UIKit Init span ends when the
users start the SentrySDK. We recommend that the SentrySDK is the first
to call in the UIApplication.didFinishLaunching method because
otherwise, users won't receive any potential crash reports for code
running before our SDK. Therefore, we pick the start time of our SDK as
when the UIApplicationDelegate.didFinishLaunching is called.

Fixes GH-3345
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instrument more app start data
2 participants