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
-
area:config bug priority:medium
难度 2/5 1-3 小时 新手友好度 88/100
Doezer/Questarr#1451 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
sidebandstudio/clawtrate#1156 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
WenyuChiou/agent-board#1993 ·
维护者通常 1 天内回复
-
bug design
难度 2/5 1-3 小时 新手友好度 88/100
Colorado-Startups/coloradostartups.org#151 ·
维护者通常 1 天内回复
-
question
难度 2/5 1-3 小时 新手友好度 78/100
jarrodwatts/claude-hud#883 · 1 条评论 ·
维护者通常 1 天内回复