Sentry initialisation uses outdated raven packages resulting in constant warnings and inability to set environments
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 32/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
Start with the setup_sentry() function and the raven and raven-aiohttp imports and dependencies it relies on, then check the sentry_sdk.init(...) snippet in the issue for the options that need to carry over. Done means setup no longer depends on raven, environment and release are passed through, and the aiohttp transport no longer triggers the asyncio loop TypeError on Python 3.10. Confirm by running Faust with a Sentry DSN set on Python 3.10. Expect a dependency migration with a design choice, so check maintainers' direction first.
由索引模型根据 Issue 内容生成。
描述
Checklist
- I have included information about relevant versions
- I have verified that the issue persists when using the
masterbranch of Faust.
Steps to reproduce
Initialise sentry normally using the built-in function setup_sentry()
Expected behavior
There should be no warnings about deprecated stuff
The sentry environment is properly set (ie, differing between production/staging environments)
Actual behavior
Many warnings are seen in the logs
The sentry environment is not properly set and all errors are sent to the same environment in sentry, so I'm unable to differentiate between which environment the error occurred on.
Full traceback
TypeError: As of 3.10, the *loop* parameter was removed from Queue() since it is no longer necessary
File "raven/base.py", line 732, in send_remote
transport = self.remote.get_transport()
File "raven/conf/remote.py", line 71, in get_transport
self._transport = self._transport_cls(**self.options)
File "raven_aiohttp.py", line 195, in __init__
self._queue = asyncio.Queue(maxsize=qsize, loop=self._loop)
File "asyncio/queues.py", line 34, in __init__
super().__init__(loop=loop)
File "asyncio/mixins.py", line 17, in __init__
raise TypeError(
Known cause
The raven and raven-aiohttp packages have not been updated since 2019. These packages do not support python 3.10, hence the constant warnings about the loop parameter. According sentry, raven has been deprecated https://docs.sentry.io/clients/python/
My solution
Initialise the current version of sentry-sdk manually:
sentry_sdk.init(
dsn=settings.SENTRY_DSN,
integrations=[_sdk_aiohttp.AioHttpIntegration()],
traces_sample_rate=settings.SENTRY_TRACES_SAMPLE_RATE,
environment=settings.SENTRY_ENVIRONMENT,
release=settings.RELEASE_VERSION,
)
Versions
- Python version: 3.10.9
- Faust version: All versions since 3.10 support was added
- Operating system: Docker (built from debian-slim-bullseye image)
- Kafka version: confluentinc/cp-kafka 7.2.2
- RocksDB version (if applicable): N/A
- 主要语言
- Python
- 星标
- 1.9k
- 派生
- 205
- 平均合并
- 2 小时 2 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
faust-streaming/faust 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
faust-streaming/faust#804 ·
-
scripts/install script forces use of ./venv virtualenv, impossible to use with virtualenvwrapper未关闭
难度 1/5 1 小时以内 新手友好度 62/100
faust-streaming/faust#28 · 1 条评论 ·
-
[BUG] SASL PLAINTEXT producer initialization fails : missing sasl_plain_username/password可能已有人在做 @wbarnha 于 56 天前认领。 未关闭
faust-streaming/faust#794 · 2 条评论 · 1 个 reaction · 已指派 2 人 ·
-
难度 4/5 3-5 天 新手友好度 18/100
faust-streaming/faust#670 ·
-
难度 4/5 3-5 天 新手友好度 18/100
faust-streaming/faust#666 ·
查看 faust-streaming/faust 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
[Maintainer] task area:visualizer
难度 1/5 1 小时以内 新手友好度 78/100
RailtownAI/railtracks#1824 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
apache/datafusion#27688 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
heasarc/heasarc-tutorials#317 ·
-
bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
mloda-ai/mloda-registry#1664 ·
维护者通常 1 天内回复