Tracing-only browser setup still bundles error-event code

オープン
#26,128 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
8.8k
フォーク
1.9k
平均マージ
1日 8時間
マージ済み PR(30日)
744

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-javascript のほかの issue

getsentry/sentry-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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