getsentry / getsentry/sentry-react-native
consoleLoggingIntegration should be opt-in per logs spec v2.0.0
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 366
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 93
説明
## Summary
The [logs spec v2.0.0](https://github.com/getsentry/sentry-docs/pull/17233) introduces a requirement that auto-emitting log integrations **MUST** be opt-in:
> Integrations that auto-emit logs MUST be opt-in. The integration MUST NOT emit any logs unless the user explicitly enables it.
Currently, `consoleLoggingIntegration` is automatically added to default integrations when `enableLogs` is truthy (`packages/core/src/js/integrations/default.ts`). Once the spec change to default `enableLogs` to `true` lands upstream, this would silently start capturing all `console.*` calls as Sentry logs for every user — causing unexpected volume and cost.
## Required Changes
- Remove `consoleLoggingIntegration` from default integrations — users should explicitly add it
- Align `enableLogs` default with spec v2.0.0 (`true`) once `@sentry/core` updates
`logEnricherIntegration` can stay as a default since it only enriches existing logs, not auto-emit new ones.
## References
- Spec PR: https://github.com/getsentry/sentry-docs/pull/17233
コントリビューションガイド
調査の方向性
packages/core/src/js/integrations/default.ts から開始し、enableLogs が truthy の場合に consoleLoggingIntegration と logEnricherIntegration がどのように含まれるかを確認します。デフォルトから自動出力する integration を削除し、enableLogs のデフォルト値を upstream の core の変更に合わせ、ユーザーが明示的に integration を追加した場合にのみ console logs が取得されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react-native, typescript
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100