Skip to content

Commit

Permalink
chore(issues): Add more logging for sample event (#54213)
Browse files Browse the repository at this point in the history
Last round of logging for sample event creation to confirm we're
handling the event in the KafkaEventStream.
  • Loading branch information
snigdhas authored Aug 4, 2023
1 parent a37714f commit 066a443
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/sentry/eventstream/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ def insert(
skip_consume: bool = False,
group_states: Optional[GroupStates] = None,
) -> None:
if event.get_tag("sample_event"):
logger.info(
"insert: inserting event",
extra={"event.id": event.event_id, "project_id": event.project_id},
)
self._dispatch_post_process_group_task(
event.event_id,
event.project_id,
Expand Down
19 changes: 19 additions & 0 deletions src/sentry/eventstream/kafka/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ def insert(
**kwargs: Any,
) -> None:
event_type = self._get_event_type(event)
if event.get_tag("sample_event"):
logger.info(
"insert: inserting event in KafkaEventStream",
extra={
"event.id": event.event_id,
"project_id": event.project_id,
"sample_event": True,
"event_type": event_type.value,
},
)

assign_partitions_randomly = (
(event_type == EventStreamEventType.Generic)
Expand All @@ -142,6 +152,15 @@ def insert(
if assign_partitions_randomly:
kwargs[KW_SKIP_SEMANTIC_PARTITIONING] = True

if event.get_tag("sample_event"):
logger.info(
"insert: inserting event in SnubaProtocolEventStream",
extra={
"event.id": event.event_id,
"project_id": event.project_id,
"sample_event": True,
},
)
super().insert(
event,
is_new,
Expand Down
13 changes: 6 additions & 7 deletions src/sentry/eventstream/snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ def insert(
) -> 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},
"insert: attempting to insert event in SnubaProtocolEventStream",
extra={
"event.id": event.event_id,
"project_id": event.project_id,
"sample_event": True,
},
)
if isinstance(event, GroupEvent) and not event.occurrence:
logger.error(
Expand Down Expand Up @@ -180,11 +184,6 @@ def insert(
# 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",
Expand Down

0 comments on commit 066a443

Please sign in to comment.