Skip to content

Replays rejected due to size limit exceeded. #12866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
rodolfoBee opened this issue Jul 11, 2024 · 8 comments
Open
3 tasks done

Replays rejected due to size limit exceeded. #12866

rodolfoBee opened this issue Jul 11, 2024 · 8 comments

Comments

@rodolfoBee
Copy link
Member

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

8.17.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup/Reproduction Example

No response

Steps to Reproduce

CSS files are inlined in the replays segments, when this file is large enough it can easily make the segment reach the size limit specially in buffer mode. When the limit is reached, the following logs are printed in the console and the replay is dropped:

logger.js:75 Sentry Logger [info]: [Replay] Stopping Replay triggered by addEventSizeExceeded
logger.js:75 Sentry Logger [info]: [Replay] Destroying compression worker
logger.js:75 Sentry Logger [log]: Adding outcome: "internal_sdk_error:replay"

No workarounds at the moment.

Expected Result

The size of the CSS file does not affect the the ability of the SDK sending the replay. The replay is sent to Sentry and the server can render the recording with CSS.

Actual Result

Replays are dropped and marked as SDK internal error in the client reports.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 11, 2024
@github-actions github-actions bot added the Package: browser Issues related to the Sentry Browser SDK label Jul 11, 2024
@lforst
Copy link
Member

lforst commented Jul 11, 2024

@billyvg @mydea What was the decision-making behind this? Intuitively there seems no real way out of the situation except for increasing the limit but obv we can't do that ad infinitum.

@mydea
Copy link
Member

mydea commented Jul 11, 2024

A possible solution would be to split the event into multiple events/segments before we send it (ensuring each is below the limit), but this is rather complex, so not sure if we want to go down the road.

Another solution, as @lforst pointed out, is also to increase the limit (a bit?), but also not sure if we want to/can do that!

@billyvg
Copy link
Member

billyvg commented Jul 11, 2024

Another possible solution is to not inline the CSS and:

  1. load the resource as defined in HTML (e.g. load from user's CDN). This has its own drawbacks (e.g. broken CSS if resource is removed, CSS can reflect what it is currently in production and not what the user saw at time of replay)

  2. cache the resource on our own infra -- adds infra complexity and costs, requires additional rrweb changes

@billyvg billyvg added Package: replay Issues related to the Sentry Replay SDK and removed Package: browser Issues related to the Sentry Browser SDK labels Jul 11, 2024
@Sammaye
Copy link

Sammaye commented Jul 12, 2024

One other option is I use releases and upload my assets to release, you could argue if I have an active release and source files you pick from those, that way you can trim the replay down as well removing assets and stuff

@chargome
Copy link
Member

related to #13059

@bruno-garcia
Copy link
Member

For reference: The max size of a segment today is 20MB uncompressed

We want to get some stats how often we drop due to max size.

Some thoughts to improve this:

  • Allow users opt-in to load their CSS from their server instead of inlining CSS. One complexity here is CORS
  • Pulling CSS file from uploaded release assets
  • Be clear on what the limitations we impose. Say: We only allow websites with a full checkout smaller than X MB (say today, 20 MB)

@mydea
Copy link
Member

mydea commented Mar 18, 2025

Is there anything we want to/can do about this in the new future? Or are we OK with the status quo, in which case I'd close this issue.

@chargome
Copy link
Member

@mydea hosting the user's css assets would be the preferred solution as this would solve some other issues as well. For a more immediate solution there is a WIP pr for detecting duplicate mutations which could also help

@mydea mydea added the Replays label Apr 14, 2025 — with Linear
@stephanie-anderson stephanie-anderson removed the Package: replay Issues related to the Sentry Replay SDK label Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

10 participants