mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-25 04:33:03 +00:00
Revert "fix: properly handle 100% thresholds to disable alerts (addresses #434)"
This reverts commit ffb744d711.
This commit is contained in:
@@ -923,35 +923,6 @@ func (m *Manager) checkMetric(resourceID, resourceName, node, instance, resource
|
||||
return
|
||||
}
|
||||
|
||||
// Special case: 100% threshold effectively disables alerts for this metric
|
||||
if threshold.Trigger >= 100 {
|
||||
log.Debug().
|
||||
Str("resource", resourceName).
|
||||
Str("metric", metricType).
|
||||
Float64("value", value).
|
||||
Float64("threshold", threshold.Trigger).
|
||||
Msg("Alert disabled (100% threshold)")
|
||||
|
||||
// Clear any existing alert for this metric
|
||||
alertID := fmt.Sprintf("%s-%s", resourceID, metricType)
|
||||
m.mu.Lock()
|
||||
if _, exists := m.activeAlerts[alertID]; exists {
|
||||
delete(m.activeAlerts, alertID)
|
||||
log.Info().
|
||||
Str("alertID", alertID).
|
||||
Str("resource", resourceName).
|
||||
Str("metric", metricType).
|
||||
Msg("Cleared alert - threshold set to 100%")
|
||||
|
||||
// Notify resolution
|
||||
if m.onResolved != nil {
|
||||
go m.onResolved(alertID)
|
||||
}
|
||||
}
|
||||
m.mu.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug().
|
||||
Str("resource", resourceName).
|
||||
Str("metric", metricType).
|
||||
|
||||
Reference in New Issue
Block a user