debug: with glitchtip amd middleware in main.py
All checks were successful
Deploy on push / deploy (push) Successful in 22s

This commit is contained in:
Stepan Vladovskiy 2024-04-01 00:25:14 -03:00
parent deb8da2363
commit c8776df610

15
main.py
View File

@ -19,6 +19,12 @@ from settings import DEV_SERVER_PID_FILE_NAME, MODE
import_module('resolvers') import_module('resolvers')
schema = make_executable_schema(load_schema_from_path('schema/'), resolvers) schema = make_executable_schema(load_schema_from_path('schema/'), resolvers)
# Initialize GlitchTip SDK with DSN from environment variable
GLITCHTIP_DSN = os.getenv('GLITCHTIP_DSN')
sentry_sdk.init(
dsn=GLITCHTIP_DSN,
traces_sample_rate=1.0
)
async def start(): async def start():
if MODE == 'development': if MODE == 'development':
@ -43,13 +49,6 @@ app = Starlette(
start, start,
], ],
on_shutdown=[redis.disconnect], on_shutdown=[redis.disconnect],
middleware=[Middleware(SentryAsgiMiddleware)],
debug=True, debug=True,
)
# Initialize GlitchTip SDK with DSN from environment variable
GLITCHTIP_DSN = os.getenv('GLITCHTIP_DSN')
sentry_sdk.init(
dsn=GLITCHTIP_DSN,
traces_sample_rate=1.0,
integrations=[SentryAsgiMiddleware(app)]
) )