Browse Source

feat: Support passing a to/from timestamp when tombstoning an event (#24680)

This is cherry picked from https://github.com/getsentry/sentry/pull/24667
and doesn't actually change reprocessing yet.
Lyn Nagara 4 years ago
parent
commit
11fbfdec33
2 changed files with 8 additions and 2 deletions
  1. 3 1
      src/sentry/eventstream/base.py
  2. 5 1
      src/sentry/eventstream/snuba.py

+ 3 - 1
src/sentry/eventstream/base.py

@@ -96,7 +96,9 @@ class EventStream(Service):
     def end_delete_tag(self, state):
         pass
 
-    def tombstone_events_unsafe(self, project_id, event_ids, old_primary_hash=False):
+    def tombstone_events_unsafe(
+        self, project_id, event_ids, old_primary_hash=False, from_timestamp=None, to_timestamp=None
+    ):
         pass
 
     def replace_group_unsafe(self, project_id, event_ids, new_group_id):

+ 5 - 1
src/sentry/eventstream/snuba.py

@@ -212,7 +212,9 @@ class SnubaProtocolEventStream(EventStream):
         state["datetime"] = datetime.now(tz=pytz.utc)
         self._send(state["project_id"], "end_delete_tag", extra_data=(state,), asynchronous=False)
 
-    def tombstone_events_unsafe(self, project_id, event_ids, old_primary_hash=False):
+    def tombstone_events_unsafe(
+        self, project_id, event_ids, old_primary_hash=False, from_timestamp=None, to_timestamp=None
+    ):
         """
         Tell Snuba to eventually delete these events.
 
@@ -239,6 +241,8 @@ class SnubaProtocolEventStream(EventStream):
             "project_id": project_id,
             "event_ids": event_ids,
             "old_primary_hash": old_primary_hash,
+            "from_timestamp": from_timestamp,
+            "to_timestamp": to_timestamp,
         }
         self._send(project_id, "tombstone_events", extra_data=(state,), asynchronous=False)