Skip to content

Commit

Permalink
Merge pull request #683 from camptocamp/fix
Browse files Browse the repository at this point in the history
Add tasks number in Prometheus
  • Loading branch information
sbrunner authored Jan 27, 2025
2 parents 087307d + 055aeac commit d419105
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions github_app_geo_project/scripts/process_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ async def __call__(self, *args: Any, **kwds: Any) -> Any:
def _watch(self) -> None:
while True:
_LOGGER.debug("Prometheus watch: alive")
try:
_NB_JOBS.labels("Tasks").set(len(asyncio.all_tasks()))
except RuntimeError:
pass
with self.Session() as session:
for status in models.JobStatus:
_NB_JOBS.labels(status.name).set(
Expand Down

0 comments on commit d419105

Please sign in to comment.