Conditions | 1 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | """ |
||
16 | def configure_sentry_for_webapp(dsn: str, environment: str, app: Flask) -> None: |
||
17 | """Initialize and configure the Sentry SDK for the Flask-based web |
||
18 | application (both in 'admin' and 'site' modes). |
||
19 | """ |
||
20 | import sentry_sdk |
||
21 | from sentry_sdk.integrations.flask import FlaskIntegration |
||
22 | |||
23 | sentry_sdk.init( |
||
24 | dsn=dsn, environment=environment, integrations=[FlaskIntegration()], |
||
25 | ) |
||
26 | |||
27 | sentry_sdk.set_tag('app_mode', app.config.get('APP_MODE')) |
||
28 | sentry_sdk.set_tag('site_id', app.config.get('SITE_ID')) |
||
29 | |||
41 |