getsentry / getsentry/sentry-python

Docs: Integration with Django ASGI + Channels Websockets

未關閉
#2,556 3 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
Docs Integration: Django Python
主要語言
Python
星號
2.2k
分支
669
平均合併
1 天 40 分鐘
30 天內合併 PR
212

描述

### Problem Statement

This Python SDK has support for django ASGI.  We noted that in this integration therer is a check for django channels and depending on that setup the SDK.

Currently, we use besides the django channels HTTP requests also the websockets. 
We did set it up as described here: [channels routing docs](https://channels.readthedocs.io/en/latest/topics/routing.html#routing) 

However, we noted that the sentry SDK is capturing the logs of the django_asgi_app and not the websocket requests.

Therefore, we currently circumvented this problem by wrapping the websockets inside the SentryASGIMiddleware.
```python
application = ProtocolTypeRouter(
{
"http": get_asgi_application(),
"websocket": SentryAsgiMiddleware(
URLRouter(routing.websocket_urlpatterns)
),
}
)
```

This should probably documented in the documentation of sentry to include these detail that it is only capturing of the http requests of django channels.

Futhermore, are were curious if this is the way to go or that a better integration is available. In our dashboard, we see now everything logged as generic asgi request for websocket connection instead of the usual transaction name and doubting if the SQL performance issues are logged as well.

### Solution Brainstorm

Update the docs to highlight the limitation of the current django integration in combination with django channels websockets.

Any suggestions how to provide more information in the integration SentryASGIMiddleware is welcome as well

貢獻指南

開啟貢獻指南

研究方向

閱讀 Django ASGI 整合文件和連結的 Channels 路由文件,然後檢查 issue 中描述的 SentryAsgiMiddleware 和 ProtocolTypeRouter 設定。記錄 websocket 的限制和支援的設定,並明確說明使用者應期待哪些請求資料和效能資料。完成的標準是清楚解釋 Django Channels 的 websocket 行為和替代方案。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
django, python
領域
backend, documentation
Issue 類型
文件
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。