Breadcrumb eviction in Scope.addBreadcrumb is reported as a discarded log_item (buffer_overflow)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- nextjs, typescript
研究方向
從 packages/core/src/scope.ts 中的 Scope.addBreadcrumb 開始,檢查 eviction 如何呼叫 recordDroppedEvent。重現包含超過 maxBreadcrumbs 個項目的情況,然後使用儲存庫中現有的 scope 行為測試(如果有)驗證 breadcrumb eviction 不再顯示為 buffer_overflow/log_item。
由索引模型根據 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.8k
- 分支
- 1.9k
- 平均合併
- 1 天 10 小時
- 30 天內合併 PR
- 608
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-javascript 的其他 Issue
-
Core Feature: Typescript Meta: Breaking
難度 2/5 1-3 小時 新手友好度 65/100
getsentry/sentry-javascript#25286 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 80/100
getsentry/sentry-javascript#24860 · 1 則留言 ·
維護者通常 1 天內回覆
-
javascript
難度 2/5 1-3 小時 新手友好度 75/100
getsentry/sentry-javascript#24200 · 2 則留言 ·
維護者通常 1 天內回覆
-
Cloudflare Workers javascript Tests
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-javascript#24051 · 1 則留言 ·
維護者通常 1 天內回覆
-
Elysia events report as `sentry.javascript.bun`可能已有人在做 @Shubham-Padkonde 於 27 天前認領。 未關閉Bug Bun javascript
難度 2/5 1-3 小時 新手友好度 92/100
getsentry/sentry-javascript#24045 · 1 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-javascript 的全部 Issue
相似的 Issue
-
Endpoint links in the tag operations list are below the 24px target size可能已有人在做 @AdzerKI 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
ai-driven-qa bug Minor
難度 2/5 1-3 小時 新手友好度 80/100
linagora/twake-tasks#435 ·
維護者通常 1 天內回覆
-
bug domain: database priority: p1 Stellar Wave
難度 2/5 1-3 小時 新手友好度 74/100
StellarState/SS-backend#632 · 1 則留言 ·
維護者通常 1 天內回覆
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)可能已有人在做 @O1sumitkumar 今天認領。 未關閉bug good first issue help wanted python
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
`cf complete zsh >> .zshrc` fails on vanilla zsh可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
cloudflare/cf#340 ·
維護者通常 1 天內回覆