diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index dafc1b5b..372cd5b4 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -6,6 +6,7 @@ on: push: branches: - 'main' + - 'feature/add-sentry' tags: - 'v*' diff --git a/docker-compose.yml b/docker-compose.yml index 5c7e4d1a..0341f802 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - "1081:1080" minio: - user: ${DOCKER_USER:-1000} + # user: ${DOCKER_USER:-1000} image: minio/minio environment: - MINIO_ROOT_USER=impress diff --git a/src/backend/core/services/ai_services.py b/src/backend/core/services/ai_services.py index b7c70405..2afe5ab9 100644 --- a/src/backend/core/services/ai_services.py +++ b/src/backend/core/services/ai_services.py @@ -72,6 +72,8 @@ class AIService: json_response = json.loads(sanitized_content) + raise RuntimeError("Error Test Sentry") + if "answer" not in json_response: raise RuntimeError("AI response does not contain an answer") diff --git a/src/backend/impress/settings.py b/src/backend/impress/settings.py index 860ef32a..1668bad1 100755 --- a/src/backend/impress/settings.py +++ b/src/backend/impress/settings.py @@ -18,6 +18,9 @@ from django.utils.translation import gettext_lazy as _ import sentry_sdk from configurations import Configuration, values from sentry_sdk.integrations.django import DjangoIntegration +from logging import getLogger + +logger = getLogger(__name__) # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -56,7 +59,7 @@ class Base(Configuration): * DB_USER """ - DEBUG = False + DEBUG = True USE_SWAGGER = False API_VERSION = "v1.0" @@ -516,9 +519,13 @@ class Base(Configuration): # The SENTRY_DSN setting should be available to activate sentry for an environment if cls.SENTRY_DSN is not None: + logger.debug("Sentry is SENTRY_ENV. %s ", cls.SENTRY_ENV) + logger.debug("Sentry is cls.__name__.lower(): %s ", cls.__name__.lower()) + print("Sentry is cls.__name__.lower(): %s ", cls.__name__.lower()) + print("Sentry is SENTRY_ENV. %s ", cls.SENTRY_ENV) sentry_sdk.init( dsn=cls.SENTRY_DSN, - environment=cls.SENTRY_ENV or cls.__name__.lower(), + environment=cls.__name__.lower(), release=get_release(), integrations=[DjangoIntegration()], )