Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'replayCanvasIntegration'),
gzip: true,
limit: '84 KB',
limit: '85 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay, Feedback)',
Expand Down
14 changes: 8 additions & 6 deletions packages/replay-internal/src/util/addEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ async function _addEvent(
} catch (error) {
const isExceeded = error && error instanceof EventBufferSizeExceededError;
const reason = isExceeded ? 'addEventSizeExceeded' : 'addEvent';
const client = getClient();

if (client) {
// We are limited in the drop reasons:
// https://github.com/getsentry/snuba/blob/6c73be60716c2fb1c30ca627883207887c733cbd/rust_snuba/src/processors/outcomes.rs#L39
const dropReason = isExceeded ? 'buffer_overflow' : 'internal_sdk_error';
client.recordDroppedEvent(dropReason, 'replay');
}

if (isExceeded && isBufferMode) {
// Clear buffer and wait for next checkout
Expand All @@ -95,12 +103,6 @@ async function _addEvent(
replay.handleException(error);

await replay.stop({ reason });

const client = getClient();

if (client) {
client.recordDroppedEvent('internal_sdk_error', 'replay');
}
}
}

Expand Down
Loading