diff --git a/src/sentry/ingest/consumer/processors.py b/src/sentry/ingest/consumer/processors.py index cb6c6f332aae3d..3f7732a05262a7 100644 --- a/src/sentry/ingest/consumer/processors.py +++ b/src/sentry/ingest/consumer/processors.py @@ -3,7 +3,6 @@ import os from collections.abc import Mapping, MutableMapping from typing import Any -from sentry.utils.event_tracker import EventTracker, EventStageStatus import orjson import sentry_sdk @@ -26,6 +25,7 @@ from sentry.utils import metrics from sentry.utils.cache import cache_key_for_event from sentry.utils.dates import to_datetime +from sentry.utils.event_tracker import EventStageStatus, EventTracker from sentry.utils.sdk import set_current_event_project from sentry.utils.snuba import RateLimitExceeded @@ -204,7 +204,9 @@ def process_event( with metrics.timer("ingest_consumer._store_event"): cache_key = processing_store.store(data) tracker = EventTracker() - tracker.record_event_stage_status(event_id=data["event_id"], status=EventStageStatus.REDIS_PUT) + tracker.record_event_stage_status( + event_id=data["event_id"], status=EventStageStatus.REDIS_PUT + ) save_attachments(attachments, cache_key) try: diff --git a/src/sentry/utils/event_tracker.py b/src/sentry/utils/event_tracker.py index 34cec123412aba..173059b8a41d02 100644 --- a/src/sentry/utils/event_tracker.py +++ b/src/sentry/utils/event_tracker.py @@ -1,6 +1,7 @@ -from enum import Enum import logging import random +from enum import Enum + class EventStageStatus(Enum): START = "start" @@ -27,10 +28,12 @@ class EventStageStatus(Enum): post_process_finished / the same as redis_deleted """ + class EventTracker: """ Logger-based implementation of EventTrackerBackend. The data will be saved in BigQuery using Google Log Sink """ + def __init__(self, sample_rate: float = 0.01): """ Args: