Allow services with multiple loaders to send their report appropriately (save-code-now, add-forge-now, ...)
A naive setup had been made to forward to project highpriority in sentry the issues. But it's not working [1] because swh.loader.highpriority is actually not a python module.
We need to change our sentry management code to actually route issues per loader/lister type. That's a need which is valid for highpriority messages (save code now), add forge now requests.
A possible implementation would be to:
- make the actual swh sentry code load an extra configuration file
- which would be a dictionary of key modules, and value sentry dsn
Hence the loader-highpriority sentry dns (which does not work) can be removed.
- [1]
Sep 08 11:17:38 worker01 python3[2165714]: Traceback (most recent call last):
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/swh/scheduler/celery_backend/config.py", line 53, in newf
Sep 08 11:17:38 worker01 python3[2165714]: return f(*args, **kwargs)
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/swh/scheduler/celery_backend/config.py", line 167, in on_worker_init
Sep 08 11:17:38 worker01 python3[2165714]: init_sentry(sentry_dsn, integrations=integrations)
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/swh/core/sentry.py", line 88, in init_sentry
Sep 08 11:17:38 worker01 python3[2165714]: release=get_sentry_release(),
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/swh/core/sentry.py", line 18, in get_sentry_release
Sep 08 11:17:38 worker01 python3[2165714]: version = pkg_resources.get_distribution(main_package).version
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 466, in get_distribution
Sep 08 11:17:38 worker01 python3[2165714]: dist = get_provider(dist)
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 342, in get_provider
Sep 08 11:17:38 worker01 python3[2165714]: return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 886, in require
Sep 08 11:17:38 worker01 python3[2165714]: needed = self.resolve(parse_requirements(requirements))
Sep 08 11:17:38 worker01 python3[2165714]: File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 772, in resolve
Sep 08 11:17:38 worker01 python3[2165714]: raise DistributionNotFound(req, requirers)
Sep 08 11:17:38 worker01 python3[2165714]: pkg_resources.DistributionNotFound: The 'swh.loader.highpriority' distribution was not found and is required by the application
Migrated from T4513 (view on Phabricator)
Edited by Antoine R. Dumont