Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug-1918203: remove use of sentry_sdk.Hub in favor of scope apis #198

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 2 additions & 4 deletions eliot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from fillmore.libsentry import set_up_sentry
from fillmore.scrubber import Scrubber, Rule, SCRUB_RULES_DEFAULT
import sentry_sdk
from sentry_sdk.hub import Hub
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
from sentry_sdk.utils import event_from_exception

Expand Down Expand Up @@ -257,16 +256,15 @@ def uncaught_error_handler(self, req, resp, ex, params):
# makes things hard to find in the Sentry interface, so we stomp on that
# with the req.path
scope.transaction.name = req.path
hub = Hub.current

event, hint = event_from_exception(
ex,
client_options=hub.client.options,
client_options=scope.get_client().options,
mechanism={"type": "eliot", "handled": False},
)

event["transaction"] = req.path
hub.capture_event(event, hint=hint)
scope.get_client().capture_event(event, hint=hint)

LOGGER.error("Unhandled exception", exc_info=sys.exc_info())
self._compose_error_response(req, resp, HTTPInternalServerError())
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PyYAML==6.0.2
requests==2.32.3
requests-mock==1.12.1
ruff==0.6.4
sentry-sdk==2.7.1
sentry-sdk==2.14.0
Sphinx==7.4.7
sphinxcontrib-httpdomain==1.8.1
sphinx-rtd-theme==2.0.0
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,9 @@ ruff==0.6.4 \
--hash=sha256:eebe4ff1967c838a1a9618a5a59a3b0a00406f8d7eefee97c70411fefc353617 \
--hash=sha256:f0f8968feea5ce3777c0d8365653d5e91c40c31a81d95824ba61d871a11b8523
# via -r requirements.in
sentry-sdk==2.7.1 \
--hash=sha256:25006c7e68b75aaa5e6b9c6a420ece22e8d7daec4b7a906ffd3a8607b67c037b \
--hash=sha256:ef1b3d54eb715825657cd4bb3cb42bb4dc85087bac14c56b0fd8c21abd968c9a
sentry-sdk==2.14.0 \
--hash=sha256:1e0e2eaf6dad918c7d1e0edac868a7bf20017b177f242cefe2a6bcd47955961d \
--hash=sha256:b8bc3dc51d06590df1291b7519b85c75e2ced4f28d9ea655b6d54033503b5bf4
# via
# -r requirements.in
# fillmore
Expand Down