diff --git a/changelog/804.bugfix.md b/changelog/804.bugfix.md new file mode 100644 index 000000000000..c2e23fd0f422 --- /dev/null +++ b/changelog/804.bugfix.md @@ -0,0 +1 @@ +Upgraded sentry-sdk to 2.8.0. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c37977e46891..19d9b0a149f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,7 +135,7 @@ tensorflow_hub = "^0.13.0" setuptools = "~70.3.0" ujson = ">=1.35,<6.0" regex = ">=2020.6,<2022.11" -sentry-sdk = ">=0.17.0,<1.15.0" +sentry-sdk = "~=2.8.0" aio-pika = ">=6.7.1,<8.2.4" aiogram = "<2.26" typing-extensions = ">=4.1.1,<5.0.0" diff --git a/rasa/telemetry.py b/rasa/telemetry.py index eaaf2b711fde..729a1f73964a 100644 --- a/rasa/telemetry.py +++ b/rasa/telemetry.py @@ -663,7 +663,7 @@ def initialize_error_reporting() -> None: from the `rasa` package. """ import sentry_sdk - from sentry_sdk import configure_scope + from sentry_sdk import Scope from sentry_sdk.integrations.atexit import AtexitIntegration from sentry_sdk.integrations.dedupe import DedupeIntegration from sentry_sdk.integrations.excepthook import ExcepthookIntegration @@ -702,7 +702,7 @@ def initialize_error_reporting() -> None: OSError, ], in_app_include=["rasa"], # only submit errors in this package - with_locals=False, # don't submit local variables + include_local_variables=False, # don't submit local variables release=f"rasa-{rasa.__version__}", default_integrations=False, environment="development" if in_continuous_integration() else "production", @@ -711,18 +711,18 @@ def initialize_error_reporting() -> None: if not telemetry_id: return - with configure_scope() as scope: - # sentry added these more recently, just a protection in a case where a - # user has installed an older version of sentry - if hasattr(scope, "set_user"): - scope.set_user({"id": telemetry_id}) - - default_context = _default_context_fields() - if hasattr(scope, "set_context"): - if "os" in default_context: - # os is a nested dict, hence we report it separately - scope.set_context("Operating System", default_context.pop("os")) - scope.set_context("Environment", default_context) + scope = Scope.get_current_scope() + # sentry added these more recently, just a protection in a case where a + # user has installed an older version of sentry + if hasattr(scope, "set_user"): + scope.set_user({"id": telemetry_id}) + + default_context = _default_context_fields() + if hasattr(scope, "set_context"): + if "os" in default_context: + # os is a nested dict, hence we report it separately + scope.set_context("Operating System", default_context.pop("os")) + scope.set_context("Environment", default_context) @contextlib.contextmanager