From 024ea3c01bc40ebdcc8cd6be1e0495025493d688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Vokr=C3=A1=C4=8Dko?= Date: Mon, 8 Jan 2024 14:51:42 +0100 Subject: [PATCH] Fix debug log for increment metric --- src/exporter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/exporter.py b/src/exporter.py index 26f4abe..5a30844 100644 --- a/src/exporter.py +++ b/src/exporter.py @@ -279,14 +279,15 @@ def track_task_event(self, event): if counter_name == event["type"]: counter.labels(**_labels).inc() + logger.debug( + "Incremented metric='{}' labels='{}'", counter._name, labels + ) elif ( event["type"] != "task-sent" ): # task-sent is sent by various hosts (webservers, task creators etc.) which cause label cardinality # pylint: disable=line-too-long # increase unaffected counters by zero in order to make them visible counter.labels(**_labels).inc(0) - logger.debug("Incremented metric='{}' labels='{}'", counter._name, labels) - # observe task runtime if event["type"] == "task-succeeded": self.celery_task_runtime.labels(**labels).observe(task.runtime)