Add debug log with degrade and missing metrics for healthcheck

This commit is contained in:
2026-02-06 07:21:04 +01:00
parent 276559d120
commit 0984c1d431

View File

@@ -11,6 +11,7 @@ import (
"slices"
"time"
cclog "github.com/ClusterCockpit/cc-lib/v2/ccLogger"
"github.com/ClusterCockpit/cc-lib/v2/schema"
)
@@ -246,6 +247,14 @@ func (m *MemoryStore) HealthCheck(cluster string,
degradedCount = len(degradedList)
healthyCount = len(expectedMetrics) - (missingCount + degradedCount)
// Debug log missing and degraded metrics
if missingCount > 0 {
cclog.ComponentDebug("metricstore", "HealthCheck: node", hostname, "missing metrics:", missingList)
}
if degradedCount > 0 {
cclog.ComponentDebug("metricstore", "HealthCheck: node", hostname, "degraded metrics:", degradedList)
}
// Determine overall health status
if missingCount > 0 || degradedCount > 0 {
if healthyCount == 0 {