Skip to content

Make it impossible to track outcomes for items that remain in the envelope #1888

Closed

Description

@jjbayer

Before #1877, we reported rate limiting outcomes for replay items that remained in the envelope. This was possible because track_outcome uses the output of EnvelopeLimiter::enforce, but that function did not actually remove replays from the envelope:

let (enforcement, rate_limits) = self.execute(&summary, scoping)?;
envelope.retain_items(|item| self.retain_item(item, &enforcement));
Ok((enforcement, rate_limits))

Not sure what's the exact solution here, but generally speaking, any function that creates an outcome should consume the item that has been dropped.

### Tasks
- [x] Refactor EnvelopeContext: https://github.com/getsentry/relay/pull/1936
- [ ] https://github.com/getsentry/relay/pull/1944
- [x] Wontfix: https://github.com/getsentry/relay/pull/1940
- [x] Make test work without running System
- [x] Wontfix: Make inner envelope private -> Won't work, because we should not update the envelope summary after the event has been extracted.

Activity

  1. added
    filler
    on Mar 6, 2023
  2. added this to the Maintenance milestone on Mar 6, 2023
  3. self-assigned this
    on Mar 14, 2023
  4. jjbayer commented on Mar 17, 2023

    @jjbayer
    MemberAuthor

    Outcomes can now be produced right where the envelope items are dropped, but the initial goal of simplifying outcome reporting in rate limits has not been achieved.

    Let's take a more top-level look at how to restructure Relay's data flow and the envelope data type (hierarchical containers instead of flat list of items?) instead.

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

Metadata

Metadata

Assignees

Labels

filler

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions