From 7f3d2024b2cf6e8c331bc2db0a8d624d4ab0fbb4 Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Thu, 23 Jul 2026 17:23:25 +0200 Subject: [PATCH 1/2] Based on: https://github.com/danihodovic/celery-exporter#usage - sent events configuration to see which queue was failed revoked etc. --- server/mergin/celery.py | 1 + server/mergin/config.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/server/mergin/celery.py b/server/mergin/celery.py index 1ed09246..e108bf66 100644 --- a/server/mergin/celery.py +++ b/server/mergin/celery.py @@ -68,6 +68,7 @@ def __call__(self, *args, **kwargs): celery.conf.update(app.config) celery.conf.update( task_acks_late=Configuration.CELERY_ACKS_LATE, + task_send_sent_event=Configuration.CELERY_TASK_SEND_SENT_EVENT, worker_concurrency=Configuration.CELERYD_CONCURRENCY, worker_prefetch_multiplier=Configuration.CELERYD_PREFETCH_MULTIPLIER, ) diff --git a/server/mergin/config.py b/server/mergin/config.py index 15773799..db1cd72a 100644 --- a/server/mergin/config.py +++ b/server/mergin/config.py @@ -69,6 +69,11 @@ class Configuration(object): "CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS", default="{}", cast=eval ) CELERY_ACKS_LATE = config("CELERY_ACKS_LATE", default=False, cast=bool) + # send a task-sent event when a task is published so that monitoring tools + # (e.g. celery-exporter) can report the queue name, including for failed tasks + CELERY_TASK_SEND_SENT_EVENT = config( + "CELERY_TASK_SEND_SENT_EVENT", default=False, cast=bool + ) CELERYD_CONCURRENCY = config("CELERYD_CONCURRENCY", default=1, cast=int) CELERYD_PREFETCH_MULTIPLIER = config( "CELERYD_PREFETCH_MULTIPLIER", default=4, cast=int From b85085993e84c49f137c31de2ae490e7992ecc39 Mon Sep 17 00:00:00 2001 From: "marcel.kocisek" Date: Fri, 24 Jul 2026 10:19:28 +0200 Subject: [PATCH 2/2] Rename variable --- server/mergin/celery.py | 3 +-- server/mergin/config.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/mergin/celery.py b/server/mergin/celery.py index e108bf66..9c7a2b39 100644 --- a/server/mergin/celery.py +++ b/server/mergin/celery.py @@ -11,7 +11,6 @@ from .config import Configuration from .app import mail - # create on flask app independent object # we need this for defining tasks, and celery is then configured in run_celery.py celery = Celery( @@ -68,7 +67,7 @@ def __call__(self, *args, **kwargs): celery.conf.update(app.config) celery.conf.update( task_acks_late=Configuration.CELERY_ACKS_LATE, - task_send_sent_event=Configuration.CELERY_TASK_SEND_SENT_EVENT, + task_send_sent_event=Configuration.CELERY_SEND_TASK_SENT_EVENT, worker_concurrency=Configuration.CELERYD_CONCURRENCY, worker_prefetch_multiplier=Configuration.CELERYD_PREFETCH_MULTIPLIER, ) diff --git a/server/mergin/config.py b/server/mergin/config.py index db1cd72a..f2041410 100644 --- a/server/mergin/config.py +++ b/server/mergin/config.py @@ -71,8 +71,8 @@ class Configuration(object): CELERY_ACKS_LATE = config("CELERY_ACKS_LATE", default=False, cast=bool) # send a task-sent event when a task is published so that monitoring tools # (e.g. celery-exporter) can report the queue name, including for failed tasks - CELERY_TASK_SEND_SENT_EVENT = config( - "CELERY_TASK_SEND_SENT_EVENT", default=False, cast=bool + CELERY_SEND_TASK_SENT_EVENT = config( + "CELERY_SEND_TASK_SENT_EVENT", default=False, cast=bool ) CELERYD_CONCURRENCY = config("CELERYD_CONCURRENCY", default=1, cast=int) CELERYD_PREFETCH_MULTIPLIER = config(