Title: Django 3.1 async views working "synchronously" with sentry_sdk · Issue #937 · getsentry/sentry-python · GitHub
Open Graph Title: Django 3.1 async views working "synchronously" with sentry_sdk · Issue #937 · getsentry/sentry-python
X Title: Django 3.1 async views working "synchronously" with sentry_sdk · Issue #937 · getsentry/sentry-python
Description: Hi, I have the following case: I'm running a production Django (3.1) application with the following sentry configuration: sentry_sdk.init( dsn=SENTRY_DSN, integrations=[ DjangoIntegration(), LoggingIntegration( event_level=logging.WARNIN...
Open Graph Description: Hi, I have the following case: I'm running a production Django (3.1) application with the following sentry configuration: sentry_sdk.init( dsn=SENTRY_DSN, integrations=[ DjangoIntegration(), Loggin...
X Description: Hi, I have the following case: I'm running a production Django (3.1) application with the following sentry configuration: sentry_sdk.init( dsn=SENTRY_DSN, integrations=[ DjangoIntegration(), Lo...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/937
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Django 3.1 async views working \"synchronously\" with sentry_sdk","articleBody":"Hi,\r\nI have the following case:\r\nI'm running a production Django (3.1) application with the following **sentry configuration**:\r\n```\r\n sentry_sdk.init(\r\n dsn=SENTRY_DSN,\r\n integrations=[\r\n DjangoIntegration(),\r\n LoggingIntegration(\r\n event_level=logging.WARNING\r\n )\r\n ],\r\n send_default_pii=True,\r\n release=SENTRY_RELEASE,\r\n traces_sample_rate=1.0\r\n )\r\n``` \r\n\r\n**The problem** is that the when I initialize the sentry_sdk **my async view is running synchronously**.\r\n\r\nAfter a bit of a **research** in the sentry_sdk code: I was trying to isolate the code that causes that and check if it's an error in my setup, and I got to the following:\r\nhttps://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/django/middleware.py#L105-L137 . So if I comment the `SentryWrappingMiddleware` **my view is back to async**. I assume that the `SentryWrappingMiddlware` is making the middleware chain synchronous which blocks the requests handling and makes the View \"sync\" at the end.\r\n \r\nSo my question is: Is it an issue in the sdk, or is it my configuration wrong? :slightly_smiling_face: \r\n\r\nIt's the last wall that stops me to migrate my views to async version:( \r\n\r\nThanks,\r\nIvo","author":{"url":"https://github.com/Ivo-Donchev","@type":"Person","name":"Ivo-Donchev"},"datePublished":"2020-11-30T10:36:24Z","url":"https://github.com/getsentry/sentry-python/issues/937"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ecf3376f-548b-4f0b-1739-3cf060a0f3fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA48:950C5:7075E8:9757D1:6B0092A3 |
| html-safe-nonce | 6900819f31dfa839c186ceb5c683caada4a90dd63aea08b386fd775baa8e228b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTQ4Ojk1MEM1OjcwNzVFODo5NzU3RDE6NkIwMDkyQTMiLCJ2aXNpdG9yX2lkIjoiNTU2NTQxMjc1NjAwMzYwMDk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a7b58ef7839addaf33e10139ea00f9ff889b943028a6013bb1c869e8b4814932 |
| hovercard-subject-tag | issue:753360279 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/937/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f621d3bfd460c72ca14b9ab67302f6fd3a91a287e4b8e1e542b9f8f9907fb75d/getsentry/sentry-python/issues/937 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f621d3bfd460c72ca14b9ab67302f6fd3a91a287e4b8e1e542b9f8f9907fb75d/getsentry/sentry-python/issues/937 |
| og:image:alt | Hi, I have the following case: I'm running a production Django (3.1) application with the following sentry configuration: sentry_sdk.init( dsn=SENTRY_DSN, integrations=[ DjangoIntegration(), Loggin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Ivo-Donchev |
| hostname | github.com |
| expected-hostname | github.com |
| None | c710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | be616a2a6ec1c609d6e002896dff5352d5c5f28b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width