Sentry initialisation uses outdated raven packages resulting in constant warnings and inability to set environments
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 32/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- observability
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Python
- Étoiles
- 1.9k
- Forks
- 205
- Merge moyen
- 2 h 2 min
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de faust-streaming/faust
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
faust-streaming/faust#804 ·
-
scripts/install script forces use of ./venv virtualenv, impossible to use with virtualenvwrapperOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
faust-streaming/faust#28 · 1 commentaire ·
-
[BUG] SASL PLAINTEXT producer initialization fails : missing sasl_plain_username/passwordPeut-être pris @wbarnha l’a pris il y a 56 jours. Ouverte
faust-streaming/faust#794 · 2 commentaires · 1 réaction · 2 personnes assignées ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 18/100
faust-streaming/faust#670 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 18/100
faust-streaming/faust#666 ·
Toutes les issues de faust-streaming/faust
Issues similaires
-
flaky: test_fire_returns_thread_per_http_entry_on_head waits 5 s per dispatch worker on busy shardsOuvertestatus/accepted type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
microsoft/apm#5309 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug vector-store
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
EverMind-AI/Raven#1413 ·
Les mainteneurs répondent en général sous 1 jour
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
ACCESS-NRI/containerised-environments-infra#143 ·
Les mainteneurs répondent en général sous 2 jours