Skip to content

Commit

Permalink
chore: drop event if event type is snapshot (we have migrated to snap…
Browse files Browse the repository at this point in the history
…shot_items (#17558)

* chore: drop event if event type is snapshot (we have migrated to snapshot_items

* Add a comment
  • Loading branch information
fuziontech authored Sep 20, 2023
1 parent 69eb2e8 commit 5870be2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions posthog/api/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
)
from posthog.kafka_client.topics import (
KAFKA_EVENTS_PLUGIN_INGESTION_HISTORICAL,
KAFKA_SESSION_RECORDING_EVENTS,
KAFKA_SESSION_RECORDING_SNAPSHOT_ITEM_EVENTS,
)
from posthog.logging.timing import timed
Expand Down Expand Up @@ -142,8 +141,6 @@ def _kafka_topic(event_name: str, data: Dict) -> str:
# and other events, we push to a different topic.

match event_name:
case "$snapshot":
return KAFKA_SESSION_RECORDING_EVENTS
case "$snapshot_items":
return KAFKA_SESSION_RECORDING_SNAPSHOT_ITEM_EVENTS
case _:
Expand All @@ -155,6 +152,11 @@ def _kafka_topic(event_name: str, data: Dict) -> str:


def log_event(data: Dict, event_name: str, partition_key: Optional[str]):
if event_name == "$snapshot":
# This is deprecated and we should no longer spend any time producing
# these events to kafka.
return

kafka_topic = _kafka_topic(event_name, data)

logger.debug("logging_event", event_name=event_name, kafka_topic=kafka_topic)
Expand Down

0 comments on commit 5870be2

Please sign in to comment.