Skip to content

Relay doesn't add outcomes/meta info if attachment is too large #4534

Closed

Description

@bruno-garcia

When an envelope with an event + attachment is sent, but the attachment is dropped due to being too large.
How about we annotate the event ("had an attachment of N MB (if we know the size, I believe we cut the stream so..) but got dropped)

Relates to:

This is a new feature of the .NET SDK, to get a heap dump (counts of allocated objects per type). I'm hoping to add this to the preview button so you can check the dump in Sentry: https://github.com/getsentry/dotnet-heapview
But the dump was too large and got dropped.

The SDK logs go to GCP (Symbol Collector) and I got:

2: 161153506
@l: "Warning"
@mt: "{0}: Attachment '{1}' dropped because it's too large ({2} bytes)."

but if it wasn't for me logging the Sentry SDK on a logging tool, I would have no idea what's going on

Replaces (private):

Activity

  1. bruno-garcia commented on Mar 5, 2025

    @bruno-garcia
    MemberAuthor

    Relates to:

    As in, we could show at the issue level how many attachments were dropped on that issue

  2. Litarnus commented on Mar 6, 2025

    @Litarnus
    Contributor

    In this case the attachment was dropped in the .NET SDK so we can't do much in relay.

    One solution could be to make the .NET SDK send a ClientReport that says that an attachment was dropped: https://develop.sentry.dev/sdk/telemetry/client-reports/
    The dropped attachment wouldn't be linked to the particular event but at least one could see that it happened in the outcomes.

  3. bruno-garcia commented on Mar 11, 2025

    @bruno-garcia
    MemberAuthor

    One solution could be to make the .NET SDK send a ClientReport that says that an attachment was dropped: develop.sentry.dev/sdk/telemetry/client-reports

    Having visibility through client reports is helpful, and we already have many, but can we tell which part of the envelope was dropped? If I send 1 event with 2 attachments, how do I know, in the SDK, that 1 or 2 attachments were dropped (and the event wasn't?)

    The dropped attachment wouldn't be linked to the particular event but at least one could see that it happened in the outcomes.

    Having a copy of the large item would be beneficial for debugging. I understand we don't do this today, but if we had the functionality where we could store 1 or N files up to ... (200 MB? or X MB?) one could investigate what's making them so large

  4. Litarnus commented on Mar 12, 2025

    @Litarnus
    Contributor

    Having visibility through client reports is helpful, and we already have many, but can we tell which part of the envelope was dropped? If I send 1 event with 2 attachments, how do I know, in the SDK, that 1 or 2 attachments were dropped (and the event wasn't?)

    Relay does not support partial dropping of attachments, we drop the entire envelope if it's too large and report the outcome Too Large. We are right now looking into adding more context to the outcome so that users can at least see what was too large (#4208).

    Having a copy of the large item would be beneficial for debugging. I understand we don't do this today, but if we had the functionality where we could store 1 or N files up to ... (200 MB? or X MB?) one could investigate what's making them so large

    I agree, that would be a cool feature!

  5. bruno-garcia commented on Mar 13, 2025

    @bruno-garcia
    MemberAuthor

    Relates to:

    Not about size ^ in this case could be due to quota enforcement. But the same idea of having some indication on the event that additional data that was on the same envelope was dropped, would be very beneficial

  6. bruno-garcia commented on Mar 13, 2025

    @bruno-garcia
    MemberAuthor

    Relay does not support partial dropping of attachments, we drop the entire envelope if it's too large and report the outcome Too Large. We are right now looking into adding more context to the outcome so that users can at least see what was too large (#4208).

    Additional context will be much appreciated.

    Regarding the size enforcement. If the envelope is not too large (compressed). Then we read the event. And when reading the attachment it turns out too be too large, do we drop out the event too?

    Or there's no code path where we accept the envelope but then drop only some items from it but not others?

  7. Litarnus commented on Mar 17, 2025

    @Litarnus
    Contributor

    Regarding the size enforcement. If the envelope is not too large (compressed). Then we read the event. And when reading the attachment it turns out too be too large, do we drop out the event too?

    Once we unpack the envelope we start to go through all individual parts and check their limits as well as the cumulative limit for the entire envelope. If either of those violate the limit, we return the Outcome that it was too large and reject the entire envelope.

    See:

    utils::check_envelope_size_limits(state.config(), managed_envelope.envelope())

    if super::check_envelope_size_limits(config, envelope).is_err() {

  8. Litarnus commented on Mar 24, 2025

    @Litarnus
    Contributor

    We deployed this PR (https://github.com/getsentry/team-ingest/issues/635), users will now see what caused the the envelope to be too large.

    I will close this issue now since it's not related to relay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions