You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Events dropped client-side for size are only logged at debug level and not recorded as lost #3209
When an envelope item is still larger than MAX_SERIALIZED_PAYLOAD_SIZE after Envelope::Item#serialize has removed breadcrumbs and reduced the stacktrace, Transport#serialize_envelope skips it with a log_debug and nothing else:
Since the event is never sent, Relay never sees it, so it doesn't show up in the invalid payload stats either. And unlike the 413 path added in #2885, no client report is recorded. With the SDK logger at the usual info level, the event is lost without any trace.
The size reduction doesn't touch extra or contexts, so a large custom payload is enough to hit this. In our case, a scheduled job reported a list of record ids in extra - the list was about 3 MB, and the event never arrived. We only noticed because we knew a report should arrive, and were confused why none did arrive.
#2381 asked for truncation of custom contexts and was declined in favor of server-side handling, with a pointer to the invalid payload stats. That makes sense for truncation, but these events never reach the server, so the stats can't show them. This issue is only about making the drop visible.
Reproduction Steps
require"logger"gem"sentry-ruby","7.2.0"require"sentry-ruby"Sentry.initdo |config|
config.dsn="http://public@127.0.0.1:9/1"# nothing listens here; the event is dropped before any requestconfig.background_worker_threads=0config.sdk_logger=Logger.new($stdout,level: ENV.fetch("LOG_LEVEL","info"))endSentry.capture_message("Found records",extra: {ids: (1..200_000).to_a})puts"discarded events: #{Sentry.get_current_client.transport.instance_variable_get(:@discarded_events).inspect}"
Expected Behavior
The drop is logged at warn level, like the 413 response.
A lost event is recorded (e.g. record_lost_event(:send_error, item.data_category, num: item.item_count, num_bytes: item.lost_event_byte_size), as in the 413 path), so it shows up in the org's stats.
Actual Behavior
With LOG_LEVEL=info, the script prints only:
discarded events: {}
With LOG_LEVEL=debug, the drop is logged, but still no lost event is recorded:
Activity
linear-code commentedon Nov 16, 2026
RUBY-244
sentry-junior commentedon Nov 16, 2026
Reproduced in getsentry/repro#94. Fix: #3210, waiting for review.