From aa3f08709feb85408f05d805e44f33d446e8bce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 20 Jun 2024 13:22:33 +0200 Subject: [PATCH] Add Prometheus watch debug message --- github_app_geo_project/module/audit/__init__.py | 1 - github_app_geo_project/scripts/process_queue.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github_app_geo_project/module/audit/__init__.py b/github_app_geo_project/module/audit/__init__.py index 05a9c9d19d8..2f364436606 100644 --- a/github_app_geo_project/module/audit/__init__.py +++ b/github_app_geo_project/module/audit/__init__.py @@ -13,7 +13,6 @@ import c2cciutils.security import github -import markdown import yaml from pydantic import BaseModel diff --git a/github_app_geo_project/scripts/process_queue.py b/github_app_geo_project/scripts/process_queue.py index aee8c3bd5f3..eed7d734659 100644 --- a/github_app_geo_project/scripts/process_queue.py +++ b/github_app_geo_project/scripts/process_queue.py @@ -687,7 +687,7 @@ async def _process_one_job( job.status = models.JobStatus.PENDING job.started_at = datetime.datetime.now(tz=datetime.timezone.utc) session.commit() - _NB_JOBS.labels(models.JobStatus.PENDING).set( + _NB_JOBS.labels(models.JobStatus.PENDING.name).set( session.query(models.Queue).filter(models.Queue.status == models.JobStatus.PENDING).count() ) @@ -803,6 +803,7 @@ async def __call__(self, *args: Any, **kwds: Any) -> Any: def _watch(self) -> None: while True: + _LOGGER.debug("Prometheus watch: alive") with self.Session() as session: for status in models.JobStatus: _NB_JOBS.labels(status.name).set(