From 06459aa2300acd95b4fa1231edfda0316b4e1ddc Mon Sep 17 00:00:00 2001 From: Jason Peacock Date: Fri, 8 Nov 2024 09:41:54 -0600 Subject: [PATCH] Fixed converting a ConfigStatus into a tuple. A ConfigStatus only has two elements when converted into a tuple. ZEN-35085 --- Products/ZenCollector/configcache/manager.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Products/ZenCollector/configcache/manager.py b/Products/ZenCollector/configcache/manager.py index ee5416baac..71e3ca7825 100644 --- a/Products/ZenCollector/configcache/manager.py +++ b/Products/ZenCollector/configcache/manager.py @@ -379,15 +379,20 @@ def task(self): if self._store is None: client = getRedisClient(url=getRedisUrl()) self._store = createObject("deviceconfigcache-store", client) - self._collect() - self._reporter.save() + try: + self._collect() + self._reporter.save() + except Exception: + logging.getLogger("zen.configcache.manager.metrics").exception( + "failed to collect/record metrics" + ) def _collect(self): counts = Counter() ages = defaultdict(list) now = time() for status in self._store.query_statuses(): - key, uid, ts = attr.astuple(status) + key, ts = attr.astuple(status) ages[type(status)].append(int(now - ts)) counts.update([type(status)])