Skip to content

Commit

Permalink
🛠️ apply pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
getsantry[bot] authored Nov 4, 2024
1 parent 3143ea2 commit cbe0288
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/sentry/ingest/consumer/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion src/sentry/utils/event_tracker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from enum import Enum
import logging
import random
from enum import Enum


class EventStageStatus(Enum):
START = "start"
Expand All @@ -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:
Expand Down

0 comments on commit cbe0288

Please sign in to comment.