-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
chore(internal): Add packages
set to SentrySdkInfo
#4598
base: main
Are you sure you want to change the base?
Conversation
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
187edbf | 1224.29 ms | 1239.69 ms | 15.40 ms |
2095ae0 | 1238.20 ms | 1251.37 ms | 13.17 ms |
df2835d | 1218.78 ms | 1238.35 ms | 19.57 ms |
8c9d1d4 | 1239.13 ms | 1253.00 ms | 13.87 ms |
62c15d4 | 1235.30 ms | 1260.82 ms | 25.52 ms |
e5ac362 | 1204.12 ms | 1229.41 ms | 25.29 ms |
72c8d84 | 1238.96 ms | 1247.34 ms | 8.38 ms |
fcde045 | 1260.71 ms | 1275.00 ms | 14.29 ms |
e3adcd5 | 1206.47 ms | 1215.39 ms | 8.92 ms |
42ef6ba | 1195.04 ms | 1214.35 ms | 19.31 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
187edbf | 21.58 KiB | 729.90 KiB | 708.32 KiB |
2095ae0 | 21.90 KiB | 709.06 KiB | 687.16 KiB |
df2835d | 21.58 KiB | 706.14 KiB | 684.55 KiB |
8c9d1d4 | 21.58 KiB | 706.97 KiB | 685.39 KiB |
62c15d4 | 22.85 KiB | 411.14 KiB | 388.29 KiB |
e5ac362 | 20.76 KiB | 426.11 KiB | 405.34 KiB |
72c8d84 | 22.85 KiB | 408.88 KiB | 386.03 KiB |
fcde045 | 20.76 KiB | 435.26 KiB | 414.50 KiB |
e3adcd5 | 21.58 KiB | 539.87 KiB | 518.28 KiB |
42ef6ba | 21.58 KiB | 417.87 KiB | 396.28 KiB |
Previous results on branch: kw/internal-add-packages-to-sdk-info
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
10894a6 | 1228.14 ms | 1248.37 ms | 20.22 ms |
1d36029 | 1236.36 ms | 1257.19 ms | 20.83 ms |
dc421e2 | 1239.73 ms | 1251.85 ms | 12.13 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
10894a6 | 22.30 KiB | 752.13 KiB | 729.83 KiB |
1d36029 | 22.30 KiB | 752.19 KiB | 729.89 KiB |
dc421e2 | 22.30 KiB | 752.19 KiB | 729.89 KiB |
…info' into kw/internal-add-packages-to-sdk-info
sdk[@"packages"] = @{ | ||
@"name" : [NSString stringWithFormat:format, self.name], | ||
@"version" : self.version | ||
}; |
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.
Based on the development docs this should be an array, I don't know if this value was used anywhere, so I just updated it to the array.
If it's not used I would consider removing it completely and only create packages in SentryClient (same as features, integrations...).
Headers docs: https://develop.sentry.dev/sdk/data-model/envelopes/#envelope-headers
SDK Info interface docs: https://develop.sentry.dev/sdk/data-model/event-payloads/sdk/
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4598 +/- ##
=============================================
+ Coverage 90.978% 91.025% +0.047%
=============================================
Files 616 620 +4
Lines 70785 71159 +374
Branches 25173 25419 +246
=============================================
+ Hits 64399 64773 +374
+ Misses 6293 6292 -1
- Partials 93 94 +1
... and 30 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
This seems like a lot of code for a small change, please when review let me know, if I've overlooked something and there is better place to save the packages to. |
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 found a view high-level issues. We need to address them before I give this a more detailed review. @krystofwoldrich we can also discuss this on a call.
andVersion:SentryMeta.versionString | ||
andPackages:[SentryMeta getSdkPackages]]; |
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.
h
: The SDKInfo of the envelope header is the same as the one from the event payload: see
This can carry the same payload as the sdk interface
in the event payload but can be carried for all events. This means that SDK
information can be carried for minidumps, session data and other submissions. - https://develop.sentry.dev/sdk/data-model/envelopes/#envelope-headers
Now that we touch both SDKInfo for the envelope header and the event payload, I think it would be great to merge the different implementations. To make this easier we could do this in an extra PR before adding the new packages implementation.
/** | ||
* Return an array of Serialized SDK packages | ||
*/ | ||
+ (NSArray<NSDictionary<NSString *, NSString *> *> *)getSdkPackagesSerialized; |
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
: I don't think the SDK packages really belong here. The SentryMeta is only about version and SDK name. getSdkPackagesSerialized
is a sign for me that it doesn't belong here. Instead, I would create an extra class just for the SDK packages. You can even write it in Swift.
#import "SentryMeta.h" | ||
#import <Foundation/Foundation.h> | ||
|
||
typedef NS_ENUM(NSUInteger, SentryPackageManagerOption) { |
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
: Can we convert this code to Swift, please?
# import "SentrySdkPackage.h" | ||
#endif | ||
|
||
@interface SentrySdkPackage () |
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
: SentrySDKPackage is internal. Why did you have to add a +Private.h
header?
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface SentrySdkPackage (Equality) |
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
: If we use a Swift struct for just the data of SentrySDKPackage you get isEqual for free.
@@ -10,6 +10,10 @@ | |||
|
|||
- Track adoption of `enablePersistingTracesWhenCrashing` (#4587) | |||
|
|||
### Internal | |||
|
|||
- Add `packages` set to SentrySdkInfo (#4598) |
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.
- 🚫 The changelog entry seems to be part of an already released section
## 8.42.0
.
Consider moving the entry to the## Unreleased
section, please.
📜 Description
This PR adds
packages
to Sentry Envelope Header SDK Info and to Sentry Event SDK Info.Before this PR
packages
were not set in the Event and in Header the Cocoa package was hardcoded.💡 Motivation and Context
This will be used by hybrid SDKs to add itself as package, later we can use this information during debugging SR and other events.
💚 How did you test it?
By sending events from Sentry SwiftUI sample and unit tests.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.