Added reset before collecting new metrics to prevent dangling metrics

This commit is contained in:
Jan Lošťák
2025-02-22 19:28:37 +01:00
parent 2b385fbade
commit 2ed310eef7
8 changed files with 73 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ func (c *PveSdnCollector) CollectMetrics() error {
return err
}
c.state.Reset()
for _, node := range cluster.NodeStatuses {
sdns := resources.FindNodeSDN(node.Name)
if len(*sdns) > 0 {