Tracing-only browser setup still bundles error-event code

未關閉
#26,128 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
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 小時
30 天內合併 PR
744

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getsentry/sentry-javascript 的其他 Issue

查看 getsentry/sentry-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。