Sentry initialisation uses outdated raven packages resulting in constant warnings and inability to set environments
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- observability
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 1.9k
- Fork
- 205
- Merge trung bình
- 2 giờ 2 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của faust-streaming/faust
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
faust-streaming/faust#804 ·
-
scripts/install script forces use of ./venv virtualenv, impossible to use with virtualenvwrapperĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
faust-streaming/faust#28 · 1 bình luận ·
-
[BUG] SASL PLAINTEXT producer initialization fails : missing sasl_plain_username/passwordCó thể đã có người làm @wbarnha đã nhận 56 ngày trước. Đang mở
faust-streaming/faust#794 · 2 bình luận · 1 reaction · 2 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
faust-streaming/faust#670 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
faust-streaming/faust#666 ·
Tất cả issue của faust-streaming/faust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Maintainer] task area:visualizer
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
RailtownAI/railtracks#1824 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
apache/datafusion#27688 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
heasarc/heasarc-tutorials#317 ·
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
mloda-ai/mloda-registry#1664 ·
Maintainer thường phản hồi trong vòng 1 ngày