mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 03:04:03 +00:00
fix: make pulse-relaxed tag use fixed thresholds instead of additive
changed pulse-relaxed behavior to override with fixed values (95% CPU/RAM, 98% disk) rather than adding to existing thresholds. this avoids confusing interactions with custom alert rules and provides more predictable behavior also updated docs to clarify the priority order of tags vs custom rules
This commit is contained in:
@@ -281,7 +281,16 @@ Control alert behavior per VM/container using Proxmox tags (no UI configuration
|
||||
#### Available Tags
|
||||
- **`pulse-no-alerts`** - Completely disables all alerts for this VM/CT
|
||||
- **`pulse-monitor-only`** - Shows in UI but suppresses notifications (email, webhooks)
|
||||
- **`pulse-relaxed`** - Increases thresholds (CPU/RAM to 95%, disk to 98%)
|
||||
- **`pulse-relaxed`** - Sets thresholds to 95% for CPU/RAM, 98% for disk
|
||||
|
||||
#### Priority Order
|
||||
Tags take precedence over other configurations:
|
||||
1. `pulse-no-alerts` tag - Overrides everything, no alerts at all
|
||||
2. `pulse-relaxed` tag - Overrides to 95%/98% regardless of custom rules
|
||||
3. Custom Alert Rules from UI - Applied if no tags present
|
||||
4. Default global thresholds - Used if nothing else is configured
|
||||
|
||||
**Note:** `pulse-monitor-only` works with any threshold source. Tags are checked every 30-60 seconds, no restart needed.
|
||||
|
||||
#### How to Use
|
||||
1. In Proxmox, edit your VM/CT
|
||||
|
||||
+12
-20
@@ -486,31 +486,23 @@ func (m *Manager) CheckGuest(guest interface{}, instanceName string) {
|
||||
|
||||
// Apply relaxed thresholds if the tag is present
|
||||
if useRelaxedThresholds {
|
||||
// Increase thresholds by 15 percentage points (e.g., 80% -> 95%)
|
||||
if thresholds.CPU != nil {
|
||||
relaxedCPU := &HysteresisThreshold{
|
||||
Trigger: min(thresholds.CPU.Trigger+15, 100),
|
||||
Clear: min(thresholds.CPU.Clear+15, 95),
|
||||
}
|
||||
thresholds.CPU = relaxedCPU
|
||||
// Override with fixed relaxed thresholds (not additive)
|
||||
// This provides consistent behavior regardless of other settings
|
||||
thresholds.CPU = &HysteresisThreshold{
|
||||
Trigger: 95,
|
||||
Clear: 90,
|
||||
}
|
||||
if thresholds.Memory != nil {
|
||||
relaxedMem := &HysteresisThreshold{
|
||||
Trigger: min(thresholds.Memory.Trigger+15, 100),
|
||||
Clear: min(thresholds.Memory.Clear+15, 95),
|
||||
}
|
||||
thresholds.Memory = relaxedMem
|
||||
thresholds.Memory = &HysteresisThreshold{
|
||||
Trigger: 95,
|
||||
Clear: 90,
|
||||
}
|
||||
if thresholds.Disk != nil {
|
||||
relaxedDisk := &HysteresisThreshold{
|
||||
Trigger: min(thresholds.Disk.Trigger+10, 100),
|
||||
Clear: min(thresholds.Disk.Clear+10, 95),
|
||||
}
|
||||
thresholds.Disk = relaxedDisk
|
||||
thresholds.Disk = &HysteresisThreshold{
|
||||
Trigger: 98,
|
||||
Clear: 95,
|
||||
}
|
||||
log.Info().
|
||||
Str("guest", name).
|
||||
Msg("Applied relaxed thresholds due to pulse:relaxed tag")
|
||||
Msg("Applied relaxed thresholds due to pulse-relaxed tag (95% CPU/RAM, 98% disk)")
|
||||
}
|
||||
|
||||
// Check each metric
|
||||
|
||||
Reference in New Issue
Block a user