Skip to content

fix(transport): Record and warn about items dropped for size - #3210

Open
sentry-junior[bot] wants to merge 2 commits into
masterfrom
fix/3209-record-oversized-item-drop
Open

sentry-junior[bot] wants to merge 2 commits into
masterfrom
fix/3209-record-oversized-item-drop

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #3209

Repro: getsentry/repro#94

When an envelope item is still larger than its size limit after Envelope::Item#serialize drops breadcrumbs and trims stack frames, Transport#serialize_envelope skipped it with only a log_debug line. At the default log level the drop left no trace, and because no lost event was recorded, it never reached client reports or the org's stats.

The drop is now logged at warn level, with the same size breakdown as before, and recorded as a send_error lost event with the item's data category, count, and byte size. That matches the HTTP 413 path, which the client reports spec also maps to send_error.

via automation evt_986cce2def3acf1f0c69ed3fe2462a31 · Run ID dispatch_9b827fa307e6a71628eb94a1ad69880a.

--

View Session [Sentry]

Envelope items that are still oversized after size reduction were skipped with only a debug log, so the drop was invisible at the default log level and never reached client reports. Log the drop at warn level and record a send_error lost event, like the HTTP 413 path.

Fixes #3209

@solnic solnic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, left just one comment with the warning logs potentially causing log flooding in some cases.

Comment thread sentry-ruby/lib/sentry/transport.rb Resolved
Later drops of the same item type are logged at debug level so apps that keep producing oversized items don't flood their logs. Every drop is still recorded as a lost event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

junior-automation:repro PR from the Junior SDK repro flow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Events dropped client-side for size are only logged at debug level and not recorded as lost

1 participant