diff --git a/api/VERSION b/api/VERSION index 81de5c5..99a89b9 100644 --- a/api/VERSION +++ b/api/VERSION @@ -1 +1 @@ -0.3.10 \ No newline at end of file +0.3.11 \ No newline at end of file diff --git a/api/server/metrics.py b/api/server/metrics.py index 69fc7a9..e384d70 100644 --- a/api/server/metrics.py +++ b/api/server/metrics.py @@ -35,22 +35,24 @@ def get_prom_metrics(): } num_task_in_q_gauge = Gauge(f"num_task_in_q", "Number of tasks in queue (not yet picked up by workers)", - labelnames=("q_name","gen_timestamp"), + labelnames=("q_name",), **common_kwargs) num_worker_gauge = Gauge("num_workers", "Number of workers", **common_kwargs) scheduled_gauge = Gauge("scheduled_tasks","Number of scheduled tasks", labelnames=("hostname",), **common_kwargs) active_gauge = Gauge("active_tasks", "Number of active tasks", labelnames=("hostname",), **common_kwargs) reserved_gauge = Gauge("reserved_tasks", "Number of reserved tasks", labelnames=("hostname",), **common_kwargs) - + last_pinged = Gauge("last_pinged", "Last pinged time", labelnames=[], **common_kwargs) # assuming we are using redis as broker import redis _r = redis.from_url(CELERY_CONFIG.broker_url) + last_pinged.set_to_current_time() + # number of tasks in queue for q in CELERY_CONFIG.task_queues.keys(): - num_task_in_q_gauge.labels(q_name=q, gen_timestamp=time.ctime()).set(_r.llen(q)) + num_task_in_q_gauge.labels(q_name=q).set(_r.llen(q)) i = app.control.inspect() diff --git a/requirements/siibra.txt b/requirements/siibra.txt index a9f558f..d5cd7fe 100644 --- a/requirements/siibra.txt +++ b/requirements/siibra.txt @@ -1,2 +1 @@ -siibra>=0.4a59 - +siibra>=0.4a61