Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/804.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgraded sentry-sdk to 2.8.0.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 14 additions & 14 deletions rasa/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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
Expand Down