diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-21 23:40:14 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-21 23:40:14 +0200 |
| commit | 4e3459bee4ecc8ceef33b0a876e584b494ad4e4a (patch) | |
| tree | 3cd76c41bef90f8ccc9d5fda8b8031b0f9281c03 /internal/check.go | |
| parent | 64c4f058e6f9975effb38e952531458054f512c3 (diff) | |
add OnlyIfNotExists alert suppression feature
Adds ability to suppress alerts during maintenance windows by checking
for the existence of a file. When the file exists and is recent (within
configured max age), matching alerts are excluded from email reports.
Features:
- Global PrometheusOnlyIfNotExists config for Prometheus alerts
- Per-check OnlyIfNotExists config for individual checks
- Configurable max age (default 86400s) for suppression file
- New "Suppressed alerts" section in email and HTML reports
- Suppressed checks excluded from counts and unhandled sections
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/check.go')
| -rw-r--r-- | internal/check.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/internal/check.go b/internal/check.go index a171c29..aabb3ec 100644 --- a/internal/check.go +++ b/internal/check.go @@ -9,13 +9,15 @@ import ( ) type check struct { - Plugin string - Args []string - DependsOn []string `json:"DependsOn,omitempty"` - Retries int `json:"Retries,omitempty"` - RetryInterval int `json:"RetryInterval,omitempty"` - RunInterval int `json:"RunInterval,omitempty"` - RandomSpread int `json:"RandomSpread,omitempty"` + Plugin string + Args []string + DependsOn []string `json:"DependsOn,omitempty"` + Retries int `json:"Retries,omitempty"` + RetryInterval int `json:"RetryInterval,omitempty"` + RunInterval int `json:"RunInterval,omitempty"` + RandomSpread int `json:"RandomSpread,omitempty"` + OnlyIfNotExists string `json:"OnlyIfNotExists,omitempty"` // Suppress alerts if this file exists and is recent + OnlyIfNotExistsMaxS int `json:"OnlyIfNotExistsMaxS,omitempty"` // Max age in seconds for suppression file (uses global default if 0) } type namedCheck struct { |
