Added Sentry (#4)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#4
This commit is contained in:
2025-06-28 06:00:15 +12:00
parent bcd9451450
commit 6eb1d1bd65
3 changed files with 32 additions and 0 deletions

View File

@ -280,3 +280,14 @@ else:
CLASSIFIER_PLUGINS = {}
PROPERTY_PLUGINS = {}
DESCRIPTOR_PLUGINS = {}
SENTRY_ENABLED = os.environ.get('SENTRY_ENABLED', 'False') == 'True'
if SENTRY_ENABLED:
import sentry_sdk
sentry_sdk.init(
dsn=os.environ.get('SENTRY_DSN'),
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
)