diff --git a/awx/main/analytics/subsystem_metrics.py b/awx/main/analytics/subsystem_metrics.py index 5854460021..aed940bf5b 100644 --- a/awx/main/analytics/subsystem_metrics.py +++ b/awx/main/analytics/subsystem_metrics.py @@ -456,7 +456,10 @@ class CustomToPrometheusMetricsCollector(prometheus_client.registry.Collector): logger.debug(f"No metric data not found in redis for metric namespace '{self._metrics._namespace}'") return None - host_metrics = instance_data.get(my_hostname) + if not (host_metrics := instance_data.get(my_hostname)): + logger.debug(f"Metric data for this node '{my_hostname}' not found in redis for metric namespace '{self._metrics._namespace}'") + return None + for _, metric in self._metrics.METRICS.items(): entry = host_metrics.get(metric.field) if not entry: