Expose Cocoa MetricKit report selection (enabledMetricReports / enabledDiagnosticReports)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- ios, react-native, typescript
- 領域
- mobile
研究方向
Start with packages/core/src/js/options.ts and packages/core/ios/RNSentryStart.m, then trace how wrapper.ts forwards options to native. First verify on a device whether an untyped metrickit dictionary reaches Cocoa; then check Cocoa’s accepted diagnostic report values and the experimental API pattern. Done means typed, documented options pass native tests and work across the listed build modes, architectures, and platforms.
由索引模型根據 Issue 內容生成。
描述
Problem
sentry-cocoa 9.33.0 (bumped in #6987) lets apps choose which MetricKit reports the SDK collects. The RN SDK has no way to set this today. It only exposes enableMetricKit and enableMetricKitRawPayload (packages/core/src/js/options.ts).
New in Cocoa 9.33.0:
options.experimental.metrickit.enabledMetricReportscan now be set through theenabledMetricReportskey of themetrickitoptions dictionary, which also accepts"all"(getsentry/sentry-cocoa#9490).- New metric reports on iOS/macOS 27+:
animationTotalHitchTime,animationTotalAnimationTime,metalFramesPerSecond,metalFrameCount,metalActiveDrawingDuration. On 27+,animationScrollHitchTimeRatiois no longer sent (getsentry/sentry-cocoa#9476). - Memory exception diagnostics on iOS 27+, collected when
enabledDiagnosticReportscontains.memoryException(getsentry/sentry-cocoa#9465).
Why this isn't blocked like #6926
SentryExperimentalOptions.metrickit is @nonobjc, which is part of what blocks #6926. But RN builds Cocoa options with RNSentryInternal optionsFromDictionary (packages/core/ios/RNSentryStart.m), and JS forwards options it doesn't know about to native (wrapper.ts initNativeSdk spreads the remaining options). So the new metrickit dictionary key should reach Cocoa's own parser without a Swift shim. That means metrickit: { enabledMetricReports: 'all' } may already work today, just without types. This hasn't been checked on a device.
Proposal
Wait until Cocoa takes these options out of experimental. Cocoa made a breaking change to the MetricReport enum in 9.33.0, so the shape is still changing. After that:
- Add a typed, iOS-only option under
_experiments, for example_experiments.metricKit: { enabledMetricReports?: string[] | 'all'; enabledDiagnosticReports?: string[] | 'all' }, and pass it through as Cocoa'smetrickitdictionary. - Check which
enabledDiagnosticReportsvalues the dictionary parser accepts. #9490 only mentionsenabledMetricReports. - Document that this only works when
enableMetricKit: true, and which reports need iOS 27+.
Acceptance criteria
- Verified on a device whether an untyped
metrickitdictionary already reaches Cocoa (and record the result). - Typed experimental option added, with JSDoc, and the API report regenerated.
- Works with CocoaPods (static/dynamic) and SwiftPM, on the old and new architecture. It does nothing on Android and other platforms.
- Tests cover the option being passed to the native options.
Related: #6926, #6457, #6987
- 主要語言
- TypeScript
- 星號
- 1.8k
- 分支
- 371
- 平均合併
- 22 小時 3 分鐘
- 30 天內合併 PR
- 106
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-react-native 的其他 Issue
-
React-Native
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-react-native#7073 · 1 則留言 ·
維護者通常 1 天內回覆
-
Improvement React-Native
難度 2/5 1-3 小時 新手友好度 80/100
getsentry/sentry-react-native#7055 · 1 則留言 ·
維護者通常 1 天內回覆
-
React-Native Replays Task
難度 2/5 1-3 小時 新手友好度 88/100
getsentry/sentry-react-native#6680 · 1 則留言 ·
維護者通常 1 天內回覆
-
Improvement React-Native
難度 2/5 1-3 小時 新手友好度 68/100
getsentry/sentry-react-native#6143 · 2 則留言 ·
維護者通常 1 天內回覆
-
React-Native Task User Feedbacks
難度 2/5 1-3 小時 新手友好度 84/100
getsentry/sentry-react-native#5932 · 2 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-react-native 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
MetaMask/eth-phishing-detect#317371 ·
維護者通常 1 天內回覆
-
android:player ios:player
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 92/100
erkamyaman/rust-anything#963 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
ZdruzenieSTROM/webstrom-frontend#934 ·
維護者通常 1 天內回覆
-
bug(worker): detector run is marked failed and never retried when span download fails可能已有人在做 @jagrutgarg 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 72/100
traceroot-ai/traceroot#3434 · 1 則留言 ·
維護者通常 1 天內回覆