Setting to enable Sentry capture_messages (#128)

This commit is contained in:
Michael Manfre 2022-12-06 11:50:42 -05:00 committed by GitHub
parent 3e313800fc
commit e2b234d9ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ def capture_message(message: str):
""" """
Sends the informational message to Sentry if it's configured Sends the informational message to Sentry if it's configured
""" """
if settings.SETUP.SENTRY_DSN: if settings.SETUP.SENTRY_DSN and settings.SENTRY_CAPTURE_MESSAGES:
from sentry_sdk import capture_message from sentry_sdk import capture_message
capture_message(message) capture_message(message)

View File

@ -87,6 +87,7 @@ class Settings(BaseSettings):
SENTRY_DSN: str | None = None SENTRY_DSN: str | None = None
SENTRY_SAMPLE_RATE: float = 1.0 SENTRY_SAMPLE_RATE: float = 1.0
SENTRY_TRACES_SAMPLE_RATE: float = 1.0 SENTRY_TRACES_SAMPLE_RATE: float = 1.0
SENTRY_CAPTURE_MESSAGES: bool = False
#: Fallback domain for links. #: Fallback domain for links.
MAIN_DOMAIN: str = "example.com" MAIN_DOMAIN: str = "example.com"