Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Integrate reviewed metric observation continuity repair

pulse-triage[bot]eff676c746c0
diff --cc internal/alerts/node.go
index 861e615ee8,978fa9aad2..6698bdf64c
--- a/internal/alerts/node.go
+++ b/internal/alerts/node.go
@@@ -93,37 -93,27 +93,37 @@@ func (m *Manager) CheckNode(node models
m.clearNodeOfflineAlert(node)
// Check each metric (only if node is online and reachable)
- // Check for host agent deduplication: if a host agent is linked to this node,
- // CPU, memory and disk usage alerts belong to the agent resource (CheckHost
- // evaluates them), so the node releases its own copies instead of alerting twice.
- if m.hasHostAgentForNode(node.ID) {
- m.releaseNodeMetricAlerts(node, "cpu", "memory", "disk")
+ // Check for host agent deduplication: a usage metric that a linked host
+ // agent evaluates belongs to the agent resource (CheckHost raises it), so
+ // the node releases its own copy instead of alerting twice. A metric the
+ // agent does not evaluate (agent alerts disabled, threshold off, usage
+ // unknown) stays with the node, so the machine is never left unmonitored.
+ link, _ := m.linkedHostAgentForNode(node.ID)
+ input := &UnifiedResourceInput{
+ ID: node.ID,
+ Type: "node",
+ Name: node.Name,
+ Node: node.Name,
+ Instance: node.Instance,
+ }
+ released := make([]string, 0, 3)
+ if link.cpu {
+ released = append(released, "cpu")
} else {
- var memoryMetric *UnifiedResourceMetric
- if node.Memory.HasKnownUsage() {
- memoryMetric = &UnifiedResourceMetric{Percent: node.Memory.Usage}
- }
- m.evaluateUnifiedMetrics(&UnifiedResourceInput{
- ID: node.ID,
- Type: "node",
- Name: node.Name,
- Node: node.Name,
- Instance: node.Instance,
- CPU: &UnifiedResourceMetric{Percent: node.CPU * 100},
- Memory: memoryMetric,
- Disk: &UnifiedResourceMetric{Percent: node.Disk.Usage},
- }, thresholds, nil, "temperature") // checkNodeTemperature owns its observation gaps.
+ input.CPU = &UnifiedResourceMetric{Percent: node.CPU * 100}
+ }
+ if link.memory {
+ released = append(released, "memory")
+ } else if node.Memory.HasKnownUsage() {
+ input.Memory = &UnifiedResourceMetric{Percent: node.Memory.Usage}
}
+ if link.disk {
+ released = append(released, "disk")
+ } else {
+ input.Disk = &UnifiedResourceMetric{Percent: node.Disk.Usage}
+ }
+ m.releaseNodeMetricAlerts(node, released...)
- m.evaluateUnifiedMetrics(input, thresholds, nil)
++ m.evaluateUnifiedMetrics(input, thresholds, nil, "temperature") // checkNodeTemperature owns its observation gaps.
// CPU temperature stays with the node even when a host agent runs on it:
// CheckHost has no CPU temperature metric, and the node poll already