Breadcrumb eviction in Scope.addBreadcrumb is reported as a discarded log_item (buffer_overflow)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- nextjs, typescript
調査の方向性
packages/core/src/scope.ts の Scope.addBreadcrumb から始め、eviction がどのように recordDroppedEvent を呼び出しているかを調べます。maxBreadcrumbs 件を超えるエントリでこのケースを再現し、その後、breadcrumb の eviction が buffer_overflow/log_item として表示されなくなっていることを、利用可能であればリポジトリに既存の scope の動作に関するテストを使って確認します。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
10.73.0
Framework Version
Next 16.3.4
Link to Sentry event
No response
Reproduction Example/SDK Setup
Any app that adds more than maxBreadcrumbs (default 100) breadcrumbs to a scope.
Steps to Reproduce
- Keep a scope alive long enough to add 101 breadcrumbs (a long-lived server scope, or a browser page with console/fetch/click breadcrumbs).
- Look at the client reports the SDK sends, or at Sentry → Stats → Outcomes for the project.
Expected Result
Breadcrumb eviction from the ring buffer is not a discarded log item. Either it is not reported as a client report at all (a breadcrumb is context, and 100 is the intended cap), or it is reported under a breadcrumb-shaped reason/category rather than log_item.
Actual Result
Scope.addBreadcrumb records a client report with reason buffer_overflow and category log_item every time the breadcrumb buffer evicts an entry:
// packages/core/src/scope.ts (develop), same in @sentry/core 10.73.0 build/cjs/scope.js:394
this._breadcrumbs.push(mergedBreadcrumb);
if (this._breadcrumbs.length > maxCrumbs) {
this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);
this._client?.recordDroppedEvent('buffer_overflow', 'log_item');
}
In Sentry's Stats page this shows up as discarded log items, client_discard · buffer_overflow, and in our project it dwarfs accepted logs: 84,981,094 "discarded" against 1,692,344 accepted log items over 7 days. We spent an investigation working out that none of those were log lines: the logs buffer flushes at 100 items / 800 KB / 5 s and never discards for this reason, so the only source of buffer_overflow · log_item in the SDK is breadcrumb eviction. The mislabel makes the Stats page read as if 98% of logs are lost in-process, when nothing is.
Suggested fix: drop the recordDroppedEvent call in addBreadcrumb, or give it its own reason/category so it cannot be read as log loss.
- 主要言語
- TypeScript
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 576
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-javascript のほかの issue
-
Browser Bug Next.js Traces Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getsentry/sentry-javascript#24672 · コメント 1 件 ·
-
Flaky Test React Router Framework Spans Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getsentry/sentry-javascript#24348 · コメント 1 件 ·
-
javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getsentry/sentry-javascript#24200 · コメント 2 件 ·
-
javascript Task
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
getsentry/sentry-javascript#24134 · コメント 1 件 ·
-
Cloudflare Workers javascript Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
getsentry/sentry-javascript#24051 · コメント 1 件 ·
getsentry/sentry-javascript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/claude-code#96687 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/DebateAI#582 · コメント 2 件 ·