Skip to content

SDK must validate envelope size to ensure errors are not silently dropped #18219

@kkmuffme

Description

@kkmuffme

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

10.25.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Sentry.captureException( new Error( "put a text > 1 MB here" ) );

Expected Result

The SDK should validate that payloads it sends are within the limits https://develop.sentry.dev/sdk/envelopes/#size-limits
If they're too large, truncate them or if that is not possible/still too large, send a generic, short event with minimum possible data to ensure that Sentry customers are at least aware that there are errors happening

Otherwise, it's possible that some errors are never reported, which makes Sentry useless

While it's possible to custom implement this validation (to some extent) via customization or by customizing tunnel/relay, I don't think it makes sense since this is something that all sentry users need

Actual Result

{"detail":"envelope exceeded size limits for type 'event' (https://develop.sentry.dev/sdk/envelopes/#size-limits)"}

Additional Context

Our site was broken for 15% of potential customers, who could not place their order, however we only found out by accident since the events never reached Sentry, resulting in significant loss in revenue

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions