From 7dd14fadb12c33841df30d4668ff9b24f5f23631 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 31 May 2024 11:27:47 +0100 Subject: Fix sentry default tags (#17251) This was broken by the sentry 2.0 upgrade Broke in v1.108.0 --- synapse/app/_base.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'synapse') diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 67e0df1459..4cc260d551 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -681,17 +681,17 @@ def setup_sentry(hs: "HomeServer") -> None: ) # We set some default tags that give some context to this instance - with sentry_sdk.configure_scope() as scope: - scope.set_tag("matrix_server_name", hs.config.server.server_name) + global_scope = sentry_sdk.Scope.get_global_scope() + global_scope.set_tag("matrix_server_name", hs.config.server.server_name) - app = ( - hs.config.worker.worker_app - if hs.config.worker.worker_app - else "synapse.app.homeserver" - ) - name = hs.get_instance_name() - scope.set_tag("worker_app", app) - scope.set_tag("worker_name", name) + app = ( + hs.config.worker.worker_app + if hs.config.worker.worker_app + else "synapse.app.homeserver" + ) + name = hs.get_instance_name() + global_scope.set_tag("worker_app", app) + global_scope.set_tag("worker_name", name) def setup_sdnotify(hs: "HomeServer") -> None: -- cgit 1.4.1