0.3.0+sentry
Some checks failed
deploy / deploy (push) Failing after 47s

This commit is contained in:
2024-04-08 09:30:57 +03:00
parent 106f1bfbde
commit c8f65ca0c9
15 changed files with 373 additions and 322 deletions

30
services/sentry.py Normal file
View File

@@ -0,0 +1,30 @@
import sentry_sdk
from sentry_sdk.integrations.ariadne import AriadneIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations.starlette import StarletteIntegration
from settings import SENTRY_DSN
def start_sentry():
# sentry monitoring
try:
sentry_sdk.init(
SENTRY_DSN,
# 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(),
RedisIntegration(),
],
)
except Exception as e:
print("[services.sentry] init error")
print(e)