diff --git a/src/sentry/utils/event_tracker.py b/src/sentry/utils/event_tracker.py index 2231f1deab0679..138c37446b9f52 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" @@ -30,10 +31,12 @@ class EventStageStatus(Enum): post_process_finished / is it 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): """ @@ -45,10 +48,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)