10000 feat: Sanic integration by untitaker · Pull Request #85 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

feat: Sanic integration #85

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

Merged
merged 3 commits into from
Sep 27, 2018
Merged
Changes from 1 commit
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
Next Next commit
ref: Remove dead code in flask integration
  • Loading branch information
untitaker committed Sep 26, 2018
commit 3848b42d6278660d4ae42f2653b3ef5e7ff62040
26 changes: 4 additions & 22 deletions sentry_sdk/integrations/flask.py
507D
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ def _push_appctx(*args, **kwargs):
# have (not the case for CLI for example)
hub = Hub.current
hub.push_scope()
with hub.configure_scope() as scope:
scope.add_event_processor(event_processor)


def _pop_appctx(*args, **kwargs):
Expand All @@ -61,26 +59,6 @@ def _request_started(sender, **kwargs):
scope.add_event_processor(_make_request_event_processor(app, weak_request))


def event_processor(event, hint):
request = getattr(_request_ctx_stack.top, "request", None)

if request:
if "transaction" not in event:
try:
event["transaction"] = request.url_rule.endpoint
except Exception:
pass

with capture_internal_exceptions():
FlaskRequestExtractor(request).extract_into_event(event)

if _should_send_default_pii():
with capture_internal_exceptions():
_add_user_to_event(event)

return event


class FlaskRequestExtractor(RequestExtractor):
def url(self):
return "%s://%s%s" % (self.request.scheme, self.request.host, self.request.path)
Expand Down Expand Up @@ -134,6 +112,10 @@ def inner(event, hint):
with capture_internal_exceptions():
FlaskRequestExtractor(request).extract_into_event(event)

if _should_send_default_pii():
with capture_internal_exceptions():
_add_user_to_event(event)

return event

return inner
Expand Down
0