getsentry / getsentry/sentry-react-native

consoleLoggingIntegration should be opt-in per logs spec v2.0.0

オープン
#5,985 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
Improvement Logs React-Native
主要言語
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。