Browse Source

chore(issues): Add more logging for sample event (#54110)

Add additional logging in the snuba insert method, follow up to #53769
Snigdha Sharma 1 year ago
parent
commit
b38c47d107
2 changed files with 11 additions and 1 deletions
  1. 1 1
      src/sentry/eventstream/base.py
  2. 10 0
      src/sentry/eventstream/snuba.py

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

@@ -141,7 +141,7 @@ class EventStream(Service):
     ) -> None:
         if event.get_tag("sample_event"):
             logger.info(
-                "inserting event",
+                "insert: inserting event",
                 extra={"event.id": event.event_id, "project_id": event.project_id},
             )
         self._dispatch_post_process_group_task(

+ 10 - 0
src/sentry/eventstream/snuba.py

@@ -119,6 +119,11 @@ class SnubaProtocolEventStream(EventStream):
         group_states: Optional[GroupStates] = None,
         **kwargs: Any,
     ) -> None:
+        if event.get_tag("sample_event") == "true":
+            logger.info(
+                "insert: attempting to insert event in Snuba",
+                extra={"event.id": event.event_id, "project_id": event.project_id},
+            )
         if isinstance(event, GroupEvent) and not event.occurrence:
             logger.error(
                 "`GroupEvent` passed to `EventStream.insert`. `GroupEvent` may only be passed when "
@@ -175,6 +180,11 @@ class SnubaProtocolEventStream(EventStream):
             # transactions processing has a configurable 'skipped contexts' to skip writing specific contexts maps
             # to the row. for now, we're ignoring that until we have a need for it
 
+        if event.get_tag("sample_event") == "true":
+            logger.info(
+                "insert: inserting event in Snuba",
+                extra={"event.id": event.event_id, "project_id": event.project_id},
+            )
         self._send(
             project.id,
             "insert",