Skip to content

Commit

Permalink
Revert "chore: drop event if event type is snapshot (we have migrated…
Browse files Browse the repository at this point in the history
… to snapshot_items" (#17560)

Revert "chore: drop event if event type is snapshot (we have migrated to snapshot_items (#17558)"

This reverts commit 5870be2.
  • Loading branch information
fuziontech authored and daibhin committed Sep 21, 2023
1 parent c9778a1 commit 4ed79a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions posthog/api/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
)
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 @@ -141,6 +142,8 @@ 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 @@ -152,11 +155,6 @@ 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 4ed79a6

Please sign in to comment.