Repository navigation
Conversation
Replace the PR link placeholder in the metricKitHangReportingMode entry with #7059.
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
…lame graphs sentry-cocoa can attach the aggregated call trees of a MetricKit hang diagnostic as an event.flamegraph attachment, which the backend symbolicates. React Native had no way to turn this on. The new experimental metricKitHangReportingMode option accepts legacy or flamegraphAttachment. React Native passes the options dictionary to the cocoa Options(dictionary:) initializer, which reads metricKitHangReportingMode, so the option needs no native code. It also works when the native SDK starts from sentry.options.json. A Jest test checks that initNativeSdk forwards the option, and Swift tests check that RNSentryStart sets experimental.metrickit.hangReportingMode from it and keeps legacy by default.
Replace the PR link placeholder in the metricKitHangReportingMode entry with #7059.
dfa285d to
75d9b44
Compare
|
This one simply allows to pass the option to the Cocoa SDK which allows to use flame graph attachments for MetricKit on iOS. |
📲 Install BuildsAndroid
|
|
It has nothing to do with that — MetricKit data cannot be combined with the JS hang data. This PR basically just exposes the option that was added in |
There was a problem hiding this comment.
The code changes LGTM!
Let's also add a Sentry link in the description.
I've tried testing this on my personal iPad but wasn't able to get a flamegraph. Since this PR just exposes the iOS implementation it should work but please add a sentry link / screenshot on the description for future reference.
It has nothing to do with that — MetricKit data cannot be combined with the JS hang data. This PR basically just exposes the option that was added in
sentry-cocoato make it possible to get MetricKit data in the format of flamegraph.json, nothing more, nothing less.
Ok. If I get this correctly the two produce separate events, right?
|
@antonis MetricKit reports come with a delay, sometimes it could take quite a while before those appear. From the sentry-cocoa doc:
From the official MetricKit doc:
Generally, it's better to ask @philprime or other sentry-cocoa folks regarding the specifics since this PR only passes the option to the native SDK. |
Yes. Again, the reason for that is that MetricKit is basically the operating system's second opinion rather than a real-time source of data. |
I believe @philprime had a way to trigger those events, I am not sure how to trigger them manually. |
📢 Type of change
📜 Description
Adds the experimental, iOS-only option
metricKitHangReportingMode('legacy' | 'flamegraphAttachment'). WithflamegraphAttachment, sentry-cocoa attaches the aggregated call trees of a MetricKit hang diagnostic as anevent.flamegraphattachment instead of a flattened stack.React Native passes the options dictionary to the cocoa
Options(dictionary:)initializer, which already readsmetricKitHangReportingMode, so no native code is needed. The option also works when the native SDK starts fromsentry.options.json.💡 Motivation and Context
sentry-cocoa added MetricKit hang flame graph attachments in getsentry/sentry-cocoa#9347, but React Native users could not turn them on. Native frames in these attachments are already symbolicated by the backend.
💚 How did you test it?
initNativeSdkforwards the option.yarn test,yarn lint,yarn circularDepCheck, andapi-report:checkpass.RNSentryCocoaTestercheck thatRNSentryStartsetsexperimental.metrickit.hangReportingModefrom the option and keepslegacyby default. The suite passes (213 tests, 0 failures).📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps