Tracing-only browser setup still bundles error-event code

Offen
#26,128 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv

Rechercherichtung

Start by tracing how BrowserClient and Client statically import eventFromException, eventFromMessage, and prepareEvent, then inspect the listed files and the tracing-only setup described in the issue. Check the existing streaming-mode work in #22580 for related transaction code paths. Done means error-event code can be excluded from a spans-only browser build while normal error capture continues to work; the issue does not specify tests.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Feature javascript Traces

A browser setup that sends only spans still bundles the client's error-event pipeline. The setup is BrowserClient with only browserTracingIntegration, no default integrations, and span streaming (the 11.x default).

  • In a minified esbuild build on 11.10.0, the Sentry SDK comes to 119.2 KB raw after removing the default integrations and debug code.
  • About 9.6 KB raw of that is error-event code. These files look unused when no error events are captured (inference, not traced at runtime):
    • browser/eventbuilder.js: 2,813 B
    • core/utils/prepareEvent.js: 2,451 B
    • core/utils/normalize.js: 1,461 B
    • browser/stack-parsers.js: 1,418 B
    • core/session.js: 881 B
    • core/utils/stacktrace.js: 840 B
  • BrowserClient and Client pull these in statically through eventFromException, eventFromMessage and prepareEvent. A tracing-only app has no way to drop them.
  • Related: #22580 covers the transaction code paths in streaming mode (utils/transactionEvent.js and envelope helpers, about 3 KB raw in the same build).

Seen in getsentry/junior's dashboard, which sends performance spans only and never error events, so that conversation content can't leak into events.

via @BYK.

--

View Session in Sentry

Vorherrschende Sprache
TypeScript
Sterne
8.8k
Forks
1.9k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
744

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-javascript

Alle Issues in getsentry/sentry-javascript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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