-
-
Notifications
You must be signed in to change notification settings - Fork 372
Log Integrations: Add SentrySwiftLog Package
#6941
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
base: main
Are you sure you want to change the base?
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| SentrySDK.start { options in | ||
| options.dsn = "https://[email protected]/123456" | ||
| options.enableLogs = true | ||
| options.beforeSendLog = { [weak self] log in |
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.
Just use public SDK API for testing. That way we don't need any kind of test helpers from the main repo, keeping it completely separate and easily transferable to a downstream repo.
SentrySwiftLog PackageSentrySwiftLog Package
| - name: Run CI Diagnostics | ||
| if: failure() | ||
| run: ./scripts/ci-diagnostics.sh | ||
|
|
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.
Bug: New test job missing from required-check dependencies
The new swiftlog-integration-unit-tests job is not included in the unit-tests-required-check job's needs array. Since unit-tests-required-check is the required status check that gates merging, failures in the swiftlog integration tests won't block the PR from merging. The job runs but its result is never validated by the required check.
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 is relevant!
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7908e84 | 1224.33 ms | 1246.39 ms | 22.06 ms |
| 9c75c11 | 1228.42 ms | 1262.81 ms | 34.39 ms |
| 795dd39 | 1216.88 ms | 1245.47 ms | 28.59 ms |
| ea12acf | 1217.67 ms | 1252.69 ms | 35.03 ms |
| fae97e5 | 1229.20 ms | 1256.27 ms | 27.06 ms |
| 1bf44b4 | 1238.14 ms | 1275.45 ms | 37.31 ms |
| 9389467 | 1218.62 ms | 1244.86 ms | 26.24 ms |
| 781f560 | 1232.83 ms | 1263.56 ms | 30.73 ms |
| ea3f7b6 | 1228.14 ms | 1258.71 ms | 30.57 ms |
| 102cf89 | 1218.31 ms | 1239.78 ms | 21.47 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7908e84 | 23.74 KiB | 872.75 KiB | 849.00 KiB |
| 9c75c11 | 23.74 KiB | 1022.95 KiB | 999.20 KiB |
| 795dd39 | 23.75 KiB | 908.16 KiB | 884.41 KiB |
| ea12acf | 23.75 KiB | 974.89 KiB | 951.14 KiB |
| fae97e5 | 23.75 KiB | 912.37 KiB | 888.62 KiB |
| 1bf44b4 | 23.75 KiB | 1021.20 KiB | 997.45 KiB |
| 9389467 | 23.75 KiB | 866.51 KiB | 842.76 KiB |
| 781f560 | 23.75 KiB | 1.02 MiB | 1016.46 KiB |
| ea3f7b6 | 23.75 KiB | 1.01 MiB | 1008.77 KiB |
| 102cf89 | 23.74 KiB | 891.02 KiB | 867.27 KiB |
Previous results on branch: feat/add-swift-log-integration
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b78f1c7 | 1213.30 ms | 1242.79 ms | 29.49 ms |
| 5c126cf | 1210.42 ms | 1237.67 ms | 27.25 ms |
| ec6df71 | 1210.16 ms | 1240.33 ms | 30.16 ms |
| 587a9b5 | 1213.80 ms | 1250.94 ms | 37.14 ms |
| e39cfe2 | 1196.87 ms | 1216.73 ms | 19.87 ms |
| b06a366 | 1212.46 ms | 1242.20 ms | 29.74 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b78f1c7 | 24.14 KiB | 1.02 MiB | 1019.59 KiB |
| 5c126cf | 24.14 KiB | 1.02 MiB | 1019.58 KiB |
| ec6df71 | 24.14 KiB | 1.02 MiB | 1019.40 KiB |
| 587a9b5 | 24.14 KiB | 1.02 MiB | 1016.89 KiB |
| e39cfe2 | 24.14 KiB | 1.02 MiB | 1016.90 KiB |
| b06a366 | 24.14 KiB | 1.02 MiB | 1016.90 KiB |
| device: "Apple TV" | ||
| scheme: "Sentry" | ||
|
|
||
| swiftlog-integration-unit-tests: |
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.
m: We should consider adding a new workflow file for integrations separate to the main SDK tests, and to not further extend it
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.
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 added a comment to replace this once #6945 is ready.
| - name: Run CI Diagnostics | ||
| if: failure() | ||
| run: ./scripts/ci-diagnostics.sh | ||
|
|
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 is relevant!
|
|
||
| var attributes: [String: Any] = [:] | ||
| attributes["sentry.origin"] = "auto.logging.swift-log" | ||
| attributes["swift-log.level"] = level.rawValue |
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.
m: Is the attribute namespacing standardized? Would it make sense to prefix with integration.?
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.
Could not find anything regarding additional attributes. My thinking was if we have sentry.x where sentry is the source, we should use swift-log.x where swift-log is the source of the data.
🚨 Detected changes in high risk code 🚨High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:
|
#skip-changelog
📜 Description
SentrySwiftLogintegration to theintegrations/logs/sentry-swift-logfolder💡 Motivation and Context
Closes #5372
Relates to #6902
💚 How did you test it?
Package.swiftversion📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.