diff --git a/clients/python/src/taskbroker_client/worker/workerchild.py b/clients/python/src/taskbroker_client/worker/workerchild.py index ab80744e..eeb04d5c 100644 --- a/clients/python/src/taskbroker_client/worker/workerchild.py +++ b/clients/python/src/taskbroker_client/worker/workerchild.py @@ -284,6 +284,15 @@ def await_task_futures(task: ActivationWithPendingFutures) -> None: ) def check_task_future_completion() -> None: + # Records how many activations with pending producer futures + # the worker child has. + metrics.gauge( + "taskworker.worker.activations_with_pending_futures", + len(pending_task_futures), + tags={ + "processing_pool": processing_pool_name, + }, + ) if len(pending_task_futures) > 0: for task in pending_task_futures.copy(): if all([f.done() for f in task.pending_futures]):