sentry-integrations
This commit is contained in:
parent
4ca9491824
commit
4b77cea690
10
main.py
10
main.py
|
@ -3,6 +3,9 @@ from importlib import import_module
|
||||||
from os.path import exists
|
from os.path import exists
|
||||||
from ariadne import load_schema_from_path, make_executable_schema
|
from ariadne import load_schema_from_path, make_executable_schema
|
||||||
from ariadne.asgi import GraphQL
|
from ariadne.asgi import GraphQL
|
||||||
|
from sentry_sdk.integrations.ariadne import AriadneIntegration
|
||||||
|
from sentry_sdk.integrations.redis import RedisIntegration
|
||||||
|
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
||||||
from starlette.applications import Starlette
|
from starlette.applications import Starlette
|
||||||
from starlette.endpoints import HTTPEndpoint, Request
|
from starlette.endpoints import HTTPEndpoint, Request
|
||||||
from starlette.responses import JSONResponse
|
from starlette.responses import JSONResponse
|
||||||
|
@ -30,7 +33,12 @@ async def start_up():
|
||||||
try:
|
try:
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
|
|
||||||
sentry_sdk.init(SENTRY_DSN)
|
sentry_sdk.init(
|
||||||
|
SENTRY_DSN,
|
||||||
|
enable_tracing=True,
|
||||||
|
integrations=[AriadneIntegration(), SqlalchemyIntegration(), RedisIntegration()],
|
||||||
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[sentry] init error")
|
print("[sentry] init error")
|
||||||
print(e)
|
print(e)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user