2024-02-16 09:34:39 +00:00
|
|
|
import sentry_sdk
|
|
|
|
from sentry_sdk.integrations.ariadne import AriadneIntegration
|
|
|
|
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
|
|
|
from sentry_sdk.integrations.starlette import StarletteIntegration
|
2024-04-09 16:50:27 +00:00
|
|
|
from settings import GLITCHTIP_DSN
|
2024-02-16 09:34:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
def start_sentry():
|
|
|
|
# sentry monitoring
|
|
|
|
try:
|
|
|
|
sentry_sdk.init(
|
2024-04-09 16:50:27 +00:00
|
|
|
GLITCHTIP_DSN,
|
2024-02-16 09:34:39 +00:00
|
|
|
# Set traces_sample_rate to 1.0 to capture 100%
|
|
|
|
# of transactions for performance monitoring.
|
|
|
|
traces_sample_rate=1.0,
|
|
|
|
# Set profiles_sample_rate to 1.0 to profile 100%
|
|
|
|
# of sampled transactions.
|
|
|
|
# We recommend adjusting this value in production.
|
|
|
|
profiles_sample_rate=1.0,
|
|
|
|
enable_tracing=True,
|
|
|
|
integrations=[
|
|
|
|
StarletteIntegration(),
|
|
|
|
AriadneIntegration(),
|
2024-08-06 11:33:52 +00:00
|
|
|
SqlalchemyIntegration()
|
2024-02-21 07:27:16 +00:00
|
|
|
],
|
2024-02-16 09:34:39 +00:00
|
|
|
)
|
|
|
|
except Exception as e:
|
2024-04-17 15:32:23 +00:00
|
|
|
print("[services.sentry] init error")
|
2024-02-16 09:34:39 +00:00
|
|
|
print(e)
|