feat: with glitchtip amd middleware in main.py
All checks were successful
Deploy on push / deploy (push) Successful in 38s
All checks were successful
Deploy on push / deploy (push) Successful in 38s
This commit is contained in:
parent
1970b197a5
commit
deb8da2363
17
main.py
17
main.py
|
@ -8,6 +8,7 @@ from ariadne import load_schema_from_path, make_executable_schema
|
||||||
from ariadne.asgi import GraphQL
|
from ariadne.asgi import GraphQL
|
||||||
from starlette.applications import Starlette
|
from starlette.applications import Starlette
|
||||||
from starlette.routing import Route
|
from starlette.routing import Route
|
||||||
|
from starlette.middleware import Middleware
|
||||||
|
|
||||||
from services.rediscache import redis
|
from services.rediscache import redis
|
||||||
from services.schema import resolvers
|
from services.schema import resolvers
|
||||||
|
@ -15,14 +16,6 @@ from services.viewed import ViewedStorage
|
||||||
from services.webhook import WebhookEndpoint
|
from services.webhook import WebhookEndpoint
|
||||||
from settings import DEV_SERVER_PID_FILE_NAME, MODE
|
from settings import DEV_SERVER_PID_FILE_NAME, MODE
|
||||||
|
|
||||||
# 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()]
|
|
||||||
)
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
@ -52,3 +45,11 @@ app = Starlette(
|
||||||
on_shutdown=[redis.disconnect],
|
on_shutdown=[redis.disconnect],
|
||||||
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)]
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user