Skip to content
Snippets Groups Projects

celery_backend/config: Enable to set Sentry DSN per task type

  1. Mar 28, 2023
    • Antoine Lambert's avatar
      celery_backend/config: Enable to set Sentry DSN per task type · ddcd7c8e
      Antoine Lambert authored
      Add a task_prerun celery signal handler in order to set Sentry DSN based
      on task name or package name.
      
      The mapping between a task/package name and its DSN must be stored in
      configuration under a "sentry_settings_for_celery_tasks" key.
      
      For this feature to work, no SWH_SENTRY_DSN and SWH_MAIN_PACKAGE environment
      variables should be defined as they override the sentry_dsn and main_package
      values passed to init_sentry function.
      
      Related to swh/meta#4949.
      ddcd7c8e
Loading