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

feat: Support tracing on Tornado #1060

Merged
merged 4 commits into from Mar 24, 2021
Merged

feat: Support tracing on Tornado #1060

merged 4 commits into from Mar 24, 2021

Conversation

untitaker
Copy link
Member

Fix #1057

with Hub(hub) as hub:
with hub.configure_scope() as scope:
scope.clear_breadcrumbs()
processor = _make_event_processor(weak_handler) # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not have the same issue as #1034 , the weak_handler is not accessible within the tornado_processor inner func https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/tornado.py#L135

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, but I believe self will stick around for the duration of the request handler invocation, which sticks around for the duration of the response streaming, so it should be fine afaict

let me add a test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the test you added covers that case since that request raises an exception and so triggers the error handler.
I would create another test to check if the request body exists when the request doesn't raise an exception and returns a success status code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually the exception won't make the request stay around for longer, but you're right it's not the same testcase so I added another one.

@ahmedetefy ahmedetefy self-requested a review March 19, 2021 11:39
Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@untitaker untitaker merged commit 4c09f32 into master Mar 24, 2021
@untitaker untitaker deleted the feat/tornado-transaction branch March 24, 2021 19:22
@untitaker
Copy link
Member Author

Yup will do, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add performance monitoring to Tornado integration
3 participants