diff --git a/src/sentry/utils/event_tracker.py b/src/sentry/utils/event_tracker.py index 96c892258980fa..205a747524b69b 100644 --- a/src/sentry/utils/event_tracker.py +++ b/src/sentry/utils/event_tracker.py @@ -1,6 +1,7 @@ +import logging from abc import ABC, abstractmethod from enum import Enum -import logging + class EventStageStatus(Enum): START = "start" @@ -26,10 +27,12 @@ class EventStageStatus(Enum): post_process_finished / the same as redis_deleted """ + class EventTrackerBackend(ABC): """ Abstract base class for event lineage tracking within a pipeline component. """ + @abstractmethod def record_processing_phase(self, event_id: str, status: EventStageStatus): """ @@ -41,10 +44,12 @@ def record_processing_phase(self, event_id: str, status: EventStageStatus): """ raise NotImplementedError + class EventTracker(EventTrackerBackend): """ Logger-based implementation of EventTrackerBackend. The data will be saved in BigQuery using Google Log Sink """ + def __init__(self): self.logger = logging.getLogger("EventTracker") logging.basicConfig(level=logging.INFO)