Skip to content

Commit

Permalink
chore(batch-exports): Add logging to get_temporal_workflow_count comm…
Browse files Browse the repository at this point in the history
…and (#27277)
  • Loading branch information
tomasfarias authored Jan 6, 2025
1 parent d36786e commit e522390
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions posthog/management/commands/get_temporal_workflow_count.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import logging

from django.conf import settings
from django.core.management.base import BaseCommand
Expand Down Expand Up @@ -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)

0 comments on commit e522390

Please sign in to comment.