Skip to content

Conversation

shashjar
Copy link
Member

@shashjar shashjar commented Oct 10, 2025

Sets up double deletion of occurrences with EAP, as described in ID-997.

When deleting events from eventstore, we should also delete from EAP using the in-progress DeleteTraceItems endpoint (protobuf definition).

Copy link

linear bot commented Oct 10, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 10, 2025
logger = logging.getLogger(__name__)


def delete_groups_from_eap_rpc(
Copy link
Member Author

Choose a reason for hiding this comment

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

Would like opinions on how to organize this code, e.g. in a separate file as drafted or alongside the Snuba eventstream impl

Copy link
Contributor

Choose a reason for hiding this comment

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

I think having a general eventstream/eap.py file to complement the existing eventstream/snuba.py file would fit the existing structure best.

Copy link
Member Author

Choose a reason for hiding this comment

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

More general question: do we want to keep the base EventStream interface for the EAP implementation? Maybe a good discussion topic for our sync tomorrow.

from sentry.testutils.cases import TestCase


class TestEAPDeletion(TestCase):
Copy link
Member Author

Choose a reason for hiding this comment

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

Basic tests for now, to be improved later

@shashjar shashjar changed the title feat(occurrences on eap): Sets up double deletion of occurrences with EAP feat(eap): Sets up double deletion of occurrences with EAP Oct 10, 2025
filter=combined_filter,
)

request = DeleteTraceItemsRequest(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do the relevant traces have associated sentry.group_ids? I had thought we would need to explicitly pull the trace IDs from the group and delete that way, but would be happy to hear that it does work this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see — we're filtering to TraceItems, not to traces themselves. (Comment)

Looks good!

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah — I see that delete using filters is not yet supported in the endpoint implementation, but my assumption was that it eventually will be.

@onewland could you confirm?

Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/sentry/deletions/tasks/nodestore.py 76.92% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #101385      +/-   ##
===========================================
+ Coverage   81.02%    81.05%   +0.02%     
===========================================
  Files        8701      8678      -23     
  Lines      386084    385268     -816     
  Branches    24409     24247     -162     
===========================================
- Hits       312837    312285     -552     
+ Misses      72896     72629     -267     
- Partials      351       354       +3     

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

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants