Skip to content

Commit ec43b68

Browse files
authored
fix(core): Stop sending client reports for breadcrumbs (#24537)
This PR removes the `{ reason: 'buffer_overflow', category: 'log_item' }` client report the SDK sent when the breadcrumbs buffer (100 breadcrumbs limit) overflowed and we evicted breadcrumbs. Why? When we started working on logs, we [wanted to know](getsentry/team-sdks#116) how many breadcrumbs we currently discard due to the 100 crumbs limit. We used the new `log_item` data category for this and `buffer_overflow` reason. Later on, we added client reports for actual log discards and re-used this data category but sent different reasons. Meaning different telemtry items now fall into the same discard bucket as reported in #24510. Since I don't think we still need to know about breadcrumb discards, and they're not their own telemetry items but part of errror and transaction events, I think we can just stop emitting client reports for them. closes #24510
1 parent ad0965f commit ec43b68

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

packages/core/src/scope.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ export class Scope {
574574
this._breadcrumbs.push(mergedBreadcrumb);
575575
if (this._breadcrumbs.length > maxCrumbs) {
576576
this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);
577-
this._client?.recordDroppedEvent('buffer_overflow', 'log_item');
578577
}
579578

580579
this._notifyScopeListeners();

packages/core/test/lib/client.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -357,22 +357,6 @@ describe('Client', () => {
357357
expect(isolationScopeBreadcrumbs).toEqual([{ message: 'hello3', timestamp: expect.any(Number) }]);
358358
});
359359

360-
test('it records `buffer_overflow` client discard reason when buffer overflows', () => {
361-
const options = getDefaultTestClientOptions({ maxBreadcrumbs: 1 });
362-
const client = new TestClient(options);
363-
const recordLostEventSpy = vi.spyOn(client, 'recordDroppedEvent');
364-
setCurrentClient(client);
365-
getIsolationScope().setClient(client);
366-
client.init();
367-
368-
addBreadcrumb({ message: 'hello1' });
369-
addBreadcrumb({ message: 'hello2' });
370-
addBreadcrumb({ message: 'hello3' });
371-
372-
expect(recordLostEventSpy).toHaveBeenCalledTimes(2);
373-
expect(recordLostEventSpy).toHaveBeenLastCalledWith('buffer_overflow', 'log_item');
374-
});
375-
376360
test('calls `beforeBreadcrumb` and adds the breadcrumb without any changes', () => {
377361
const beforeBreadcrumb = vi.fn(breadcrumb => breadcrumb);
378362
const options = getDefaultTestClientOptions({ beforeBreadcrumb });

0 commit comments

Comments
 (0)