From 8ff11ddc8357dc5cf1077f193d1f4db72109fc65 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Sun, 15 Sep 2024 09:05:19 +0200 Subject: [PATCH] Sentry integrated in Django --- backend/requirements.txt | 1 + backend/videoflix/videoflix/settings.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/backend/requirements.txt b/backend/requirements.txt index 4de07ad..57303a1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -28,6 +28,7 @@ python-decouple==3.8 redis==5.0.8 requests==2.32.3 rq==1.16.2 +sentry-sdk==2.14.0 setuptools==72.1.0 six==1.16.0 sqlparse==0.5.1 diff --git a/backend/videoflix/videoflix/settings.py b/backend/videoflix/videoflix/settings.py index 3f48c24..658dd52 100644 --- a/backend/videoflix/videoflix/settings.py +++ b/backend/videoflix/videoflix/settings.py @@ -13,6 +13,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/ import os from pathlib import Path from decouple import config +import sentry_sdk # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -219,3 +220,16 @@ AUTHENTICATION_BACKENDS = ( 'auth.custom_backend.EmailBackend', 'django.contrib.auth.backends.ModelBackend', ) + +# Sentry + +sentry_sdk.init( + dsn="https://f9cac097dbb7a0d104f07d347e1bd470@o4507955559464960.ingest.de.sentry.io/4507955586138192", + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for tracing. + 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, +) \ No newline at end of file