From e5223909a7bbc53d9e7e696e3c45682c8cdb1a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 6 Jan 2025 15:21:30 +0100 Subject: [PATCH] chore(batch-exports): Add logging to get_temporal_workflow_count command (#27277) --- .../management/commands/get_temporal_workflow_count.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/posthog/management/commands/get_temporal_workflow_count.py b/posthog/management/commands/get_temporal_workflow_count.py index 27b2bd776a1dd..7a1f26f16e390 100644 --- a/posthog/management/commands/get_temporal_workflow_count.py +++ b/posthog/management/commands/get_temporal_workflow_count.py @@ -1,4 +1,5 @@ import asyncio +import logging from django.conf import settings from django.core.management.base import BaseCommand @@ -91,10 +92,14 @@ def handle(self, *args, **options): ) if track_gauge: + logging.debug(f"Tracking count in Gauge: {track_gauge}") gauge = Gauge( track_gauge, - f"Number of Temporal Workflow executions in '{task_queue}' with status '{execution_status}'.", + f"Number of current Temporal Workflow executions.", + labelnames=["task_queue", "status"], ) - gauge.set(result.count) + gauge.labels(task_queue=task_queue, status=execution_status.lower()).set(result.count) + + logging.info(f"Count of '{execution_status.lower()}' workflows in '{task_queue}': {result.count}") return str(result.count)