getsentry / getsentry/sentry-react-native

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

Offen
#5,985 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Improvement Logs React-Native
Vorherrschende Sprache
TypeScript
Sterne
1.8k
Forks
366
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
93

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in packages/core/src/js/integrations/default.ts und prüfe, wie consoleLoggingIntegration und logEnricherIntegration eingeschlossen werden, wenn enableLogs truthy ist. Entferne die automatisch emittierende Integration aus den Defaults, gleiche den enableLogs-Standardwert an die vorgelagerte core-Änderung an und verifiziere, dass Konsolen-Logs nur erfasst werden, wenn Benutzer die Integration ausdrücklich hinzufügen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native, typescript
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.