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

@@ -78,6 +78,12 @@ func (c *PveSubscriptionCollector) CollectMetrics() error {
return err
}
c.info.Reset()
c.status.Reset()
c.nextDueDate.Reset()
c.regDate.Reset()
c.sockets.Reset()
for _, node := range cluster.NodeStatuses {
labels := prometheus.Labels{
"cluster": cluster.GetClusterName(),