Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Breadcrumb eviction in Scope.addBreadcrumb is reported as a discarded log_item (buffer_overflow)

Closed Beginner friendly
#24,510 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
nextjs, typescript
Domain
observability

Research direction

Start in packages/core/src/scope.ts at Scope.addBreadcrumb and inspect how eviction calls recordDroppedEvent. Reproduce the case with more than maxBreadcrumbs entries, then verify that breadcrumb eviction no longer appears as buffer_overflow/log_item, using the repository's existing tests for scope behavior if available.

Written by the indexing model from the issue text.

Description

Client Reports Next.js Waiting for: Product Owner
Is there an existing issue for this?
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
  1. Keep a scope alive long enough to add 101 breadcrumbs (a long-lived server scope, or a browser page with console/fetch/click breadcrumbs).
  2. 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.

Dominant language
TypeScript
Stars
8.7k
Forks
1.9k
Avg merge
1d 16h
Merged PRs (30d)
576

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-javascript

All issues in getsentry/sentry-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.