Skip to content

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented May 27, 2024

For invidual_attachments, we can now send the data inline if it is small enough. This avoids having to store temporary attachment_chunks in the processing redis store.

Right now, every "event" attachment is sent with outlined chunks, even for things like logfiles, even though only minidumps and other processing-relevant attachments need to be treated that way.
It might be possible to also inline logfiles with more logic. That way, such attachments could be saved as EventAttachment directly without putting load on the attachments store. Doing that however would create problems when such events are discarded within the rest of the pipeline.

Support for consuming the data property is being added in getsentry/sentry#71522 to the Sentry codebase.


Developing this, I noticed that extract_kafka_messages_for_event is a free function returning an Iterator purely for testing purposes. These tests pretty much just tested the send_individual_attachments logic in a very convoluted way, and are now pretty useless.

@Swatinem Swatinem self-assigned this May 27, 2024
@Swatinem Swatinem requested a review from a team as a code owner May 27, 2024 14:41
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, could you please add an integration test for the new behavior? See test_attachments_with_processing as an example.

Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two integration tests are still failing, could be that they are just flaky though.

Swatinem added a commit to getsentry/sentry that referenced this pull request May 29, 2024
For `invidual_attachments`, we can now send the `data` inline if it is small enough.
This avoids having to store temporary `attachment_chunks` in the processing redis store.
@Swatinem Swatinem force-pushed the swatinem/skip-single-attachment-chunks branch from 2615cb9 to 9991ff0 Compare May 31, 2024 08:23
@Swatinem
Copy link
Member Author

Thanks for all the feedback! I rebased/squashed the PR, added documentation to the function, and cleaned up the flow in the caller.

@Swatinem Swatinem merged commit 703a2e1 into master May 31, 2024
@Swatinem Swatinem deleted the swatinem/skip-single-attachment-chunks branch May 31, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants