Skip to content

Commit

Permalink
Failsafe in case config for transaction_processing_store is incorrect (
Browse files Browse the repository at this point in the history
…#80463)

If the transactions configuration is wrong for any reason, fall back to
the default processing memorystore.
  • Loading branch information
kneeyo1 authored Nov 11, 2024
1 parent 3249e72 commit 59bf9d8
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/sentry/eventstore/processing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sentry_sdk
from django.conf import settings

from sentry.eventstore.processing.base import EventProcessingStore
Expand All @@ -14,16 +15,26 @@
settings.SENTRY_TRANSACTION_PROCESSING_STORE
and settings.SENTRY_TRANSACTION_PROCESSING_STORE_OPTIONS
):
transaction_processing_store = LazyServiceWrapper(
EventProcessingStore,
settings.SENTRY_TRANSACTION_PROCESSING_STORE,
settings.SENTRY_TRANSACTION_PROCESSING_STORE_OPTIONS,
)
try:
transaction_processing_store = LazyServiceWrapper(
EventProcessingStore,
settings.SENTRY_TRANSACTION_PROCESSING_STORE,
settings.SENTRY_TRANSACTION_PROCESSING_STORE_OPTIONS,
)
except BaseException as e:
sentry_sdk.capture_exception(e)
transaction_processing_store = LazyServiceWrapper(
EventProcessingStore,
settings.SENTRY_EVENT_PROCESSING_STORE,
settings.SENTRY_EVENT_PROCESSING_STORE_OPTIONS,
)

else:
transaction_processing_store = LazyServiceWrapper(
EventProcessingStore,
settings.SENTRY_EVENT_PROCESSING_STORE,
settings.SENTRY_EVENT_PROCESSING_STORE_OPTIONS,
)


__all__ = ["event_processing_store", "transaction_processing_store"]

0 comments on commit 59bf9d8

Please sign in to comment.