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

Set response status code in transaction "response" context. #2312

Merged
merged 27 commits into from Aug 29, 2023

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Aug 17, 2023

Make sure that the HTTP response status code be set in the transactions "response" context.

This works in WSGI (was already calling set_http_status.) Also added this to ASGI projects.

Fixes #2289

@antonpirker antonpirker force-pushed the antonpirker/2289-response-status-code branch from 9ad3478 to 0ee7172 Compare August 28, 2023 15:04
@antonpirker antonpirker marked this pull request as ready for review August 29, 2023 10:59
Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

Nicely done working around the asgi 2/3 differences! Left some nits to consider but LGTM.

sentry_sdk/tracing.py Show resolved Hide resolved
sentry_sdk/integrations/asgi.py Outdated Show resolved Hide resolved
sentry_sdk/integrations/asgi.py Outdated Show resolved Hide resolved
sentry_sdk/integrations/asgi.py Outdated Show resolved Hide resolved
sentry_sdk/integrations/asgi.py Show resolved Hide resolved
@antonpirker antonpirker enabled auto-merge (squash) August 29, 2023 12:39
@antonpirker antonpirker merged commit 46c24ea into master Aug 29, 2023
246 checks passed
@antonpirker antonpirker deleted the antonpirker/2289-response-status-code branch August 29, 2023 12:52
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 response status code to transaction response context
2 participants