getsentry / getsentry/sentry-react-native

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

Đang mở
#5,985 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Improvement Logs React-Native
Ngôn ngữ chính
TypeScript
Star
1.8k
Fork
366
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
94

Mô tả

## 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu trong packages/core/src/js/integrations/default.ts và kiểm tra cách consoleLoggingIntegration và logEnricherIntegration được đưa vào khi enableLogs là truthy. Xóa integration tự động phát ra khỏi các giá trị mặc định, đồng bộ giá trị mặc định của enableLogs với thay đổi upstream của core và xác minh rằng các log console chỉ được thu thập khi người dùng thêm integration một cách rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native, typescript
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.