diff --git a/src/sentry/runner/main.py b/src/sentry/runner/main.py index 9fdf90600d08ca..5c44f79b179714 100644 --- a/src/sentry/runner/main.py +++ b/src/sentry/runner/main.py @@ -135,7 +135,8 @@ def main() -> None: func(**kwargs) except Exception as e: # This reports errors sentry-devservices - with sentry_sdk.init(dsn=os.environ["SENTRY_DEVSERVICES_DSN"]): + with sentry_sdk.new_scope() as scope: + scope.set_client(sentry_sdk.Client(dsn=os.environ["SENTRY_DEVSERVICES_DSN"])) if os.environ.get("USER"): sentry_sdk.set_user({"username": os.environ.get("USER")}) sentry_sdk.capture_exception(e)