Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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