From 2d46b7d504ac5258c6c8f6236ec6d74b973a5e4b Mon Sep 17 00:00:00 2001 From: Quentin BEY Date: Fri, 25 Oct 2024 13:35:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(backend)=20fix=20sentry=20deprecat?= =?UTF-8?q?ed=20scope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `sentry_sdk.configure_scope` is deprecated and will be removed in the next major version. --- src/backend/people/settings.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/people/settings.py b/src/backend/people/settings.py index 05e551f..4f719cb 100755 --- a/src/backend/people/settings.py +++ b/src/backend/people/settings.py @@ -490,8 +490,10 @@ class Base(Configuration): integrations=[DjangoIntegration()], traces_sample_rate=0.1, ) - with sentry_sdk.configure_scope() as scope: - scope.set_extra("application", "backend") + + # Add the application name to the Sentry scope + scope = sentry_sdk.get_global_scope() + scope.set_tag("application", "backend") # Ignore the logs added by the DockerflowMiddleware ignore_logger("request.summary")