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

impr: Add uptime to SDK log messages #4781

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

philipphofmann
Copy link
Member

📜 Description

Add the system uptime to the SDK log messages to know precisely when the logger logs. This can help when investigating issues by reading the SDK log messages.

💡 Motivation and Context

For investigating the raw logs of flaky tests this can be highly useful to understand exactly where a test might have hanged.

💚 How did you test it?

Unit tests.

📝 Checklist

You have to check all boxes before merging:

  • 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.
  • I updated the wizard 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

Add the system uptime to the SDK log messages to know precisely when the
logger logs. This can help when investigating issues by reading the SDK
log messages.
Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1226.76 ms 1250.80 ms 24.04 ms
Size 22.31 KiB 780.97 KiB 758.66 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b9d59f7 1250.71 ms 1257.78 ms 7.06 ms
9ce54cc 1230.31 ms 1237.20 ms 6.90 ms
72c8d84 1238.96 ms 1247.34 ms 8.38 ms
f8833c4 1236.45 ms 1252.82 ms 16.37 ms
7cd187e 1243.04 ms 1244.79 ms 1.75 ms
253bb71 1221.62 ms 1250.82 ms 29.20 ms
3eb2a52 1241.48 ms 1250.50 ms 9.02 ms
21fd61f 1226.42 ms 1247.52 ms 21.10 ms
1bbcb9c 1189.61 ms 1223.50 ms 33.89 ms
be51b56 1220.84 ms 1249.36 ms 28.52 ms

App size

Revision Plain With Sentry Diff
b9d59f7 22.85 KiB 405.77 KiB 382.93 KiB
9ce54cc 21.58 KiB 573.71 KiB 552.13 KiB
72c8d84 22.85 KiB 408.88 KiB 386.03 KiB
f8833c4 21.58 KiB 422.66 KiB 401.08 KiB
7cd187e 20.76 KiB 401.65 KiB 380.89 KiB
253bb71 20.76 KiB 393.37 KiB 372.60 KiB
3eb2a52 20.76 KiB 393.38 KiB 372.62 KiB
21fd61f 20.76 KiB 435.50 KiB 414.74 KiB
1bbcb9c 20.76 KiB 426.10 KiB 405.34 KiB
be51b56 20.76 KiB 432.20 KiB 411.44 KiB

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.390%. Comparing base (3dcba20) to head (dd0011a).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4781       +/-   ##
=============================================
- Coverage   91.395%   91.390%   -0.005%     
=============================================
  Files          627       627               
  Lines        74573     74594       +21     
  Branches     26823     26838       +15     
=============================================
+ Hits         68156     68172       +16     
- Misses        6319      6323        +4     
- Partials        98        99        +1     
Files with missing lines Coverage Δ
Sources/Swift/Tools/SentryLog.swift 78.947% <100.000%> (+4.479%) ⬆️
Tests/SentryTests/Helper/SentryLog.swift 100.000% <100.000%> (ø)
Tests/SentryTests/Helper/SentryLogTests.swift 100.000% <100.000%> (ø)

... and 8 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 3dcba20...dd0011a. Read the comment docs.

Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

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

We can't send this data off-device, see https://developer.apple.com/documentation/bundleresources/app-privacy-configuration/nsprivacyaccessedapitypes/nsprivacyaccessedapitype?language=objc (search for NSPrivacyAccessedAPICategorySystemBootTime).

The only exception is derived data that calculates a duration. Otherwise, we can't send the raw value or other derivations off-device.

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.

2 participants